jprichardson / jprichardson/node-scrap

Tests failing, 'F' and 'T' undefined

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
33
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Hi,

I just found this package while prototyping one of my projects and it seems to do the job just fine despite not being maintained. However, I can't get tests to work due to undefined references to 'F' and 'T'.

Result of 'npm test' below:

scrap
   > when it contains the html modifier pre parse function
     1) should apply it before loading it into cheerio
   > when it can reach the site
     2) should retrieve the content
   > when it cant find the page
     3) should return an error


 0 passing (53ms)
 3 failing

 1) scrap > when it contains the html modifier pre parse function should apply it before loading it into cheerio:
    Uncaught ReferenceError: F is not defined
     at D:\workspace\node-scrap\test\scrap.test.js:34:9
     at parseBody (D:\workspace\node-scrap\lib\scrap.js:36:3)
     at D:\workspace\node-scrap\lib\scrap.js:19:9
     at Object.preParse (D:\workspace\node-scrap\test\scrap.test.js:31:11)
     at Request._callback (D:\workspace\node-scrap\lib\scrap.js:18:12)
     at Request.self.callback (D:\workspace\node-scrap\node_modules\request\request.js:186:22)
     at Request.<anonymous> (D:\workspace\node-scrap\node_modules\request\request.js:1163:10)
     at IncomingMessage.<anonymous> (D:\workspace\node-scrap\node_modules\request\request.js:1085:12)
     at endReadableNT (_stream_readable.js:1055:12)
     at _combinedTickCallback (internal/process/next_tick.js:138:11)
     at process._tickCallback (internal/process/next_tick.js:180:9)

 2) scrap > when it can reach the site should retrieve the content:
    Uncaught ReferenceError: F is not defined
     at D:\workspace\node-scrap\test\scrap.test.js:47:9
     at parseBody (D:\workspace\node-scrap\lib\scrap.js:36:3)
     at Request._callback (D:\workspace\node-scrap\lib\scrap.js:22:7)
     at Request.self.callback (D:\workspace\node-scrap\node_modules\request\request.js:186:22)
     at Request.<anonymous> (D:\workspace\node-scrap\node_modules\request\request.js:1163:10)
     at IncomingMessage.<anonymous> (D:\workspace\node-scrap\node_modules\request\request.js:1085:12)
     at endReadableNT (_stream_readable.js:1055:12)
     at _combinedTickCallback (internal/process/next_tick.js:138:11)
     at process._tickCallback (internal/process/next_tick.js:180:9)

 3) scrap > when it cant find the page should return an error:
    Uncaught ReferenceError: T is not defined
     at D:\workspace\node-scrap\test\scrap.test.js:60:9
     at Request._callback (D:\workspace\node-scrap\lib\scrap.js:15:41)
     at Request.self.callback (D:\workspace\node-scrap\node_modules\request\request.js:186:22)
     at Request.<anonymous> (D:\workspace\node-scrap\node_modules\request\request.js:1163:10)
     at IncomingMessage.<anonymous> (D:\workspace\node-scrap\node_modules\request\request.js:1085:12)
     at endReadableNT (_stream_readable.js:1055:12)
     at _combinedTickCallback (internal/process/next_tick.js:138:11)
     at process._tickCallback (internal/process/next_tick.js:180:9)

Any hint where those two functions come from?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/scrap.test.js at the failing lines and compare those references with lib/scrap.js, especially the callbacks around lines 15-36. Run npm test to reproduce the three failures; done means the undefined references are resolved and all three tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.