Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run mocha tests with blanket - CH11 #33

Open
dustin-lennon opened this issue May 15, 2015 · 2 comments
Open

Not able to run mocha tests with blanket - CH11 #33

dustin-lennon opened this issue May 15, 2015 · 2 comments

Comments

@dustin-lennon
Copy link

I'm at the portion of your book where I'm running the code-coverage test with blanket and I am having the following error being thrown:

C:\meanstack>npm test

socialapp@ test C:\meanstack
jshint . && mocha && protractor

C:\meanstack\controllers\api\users.js:2
if (typeof _$jscoverage['C:\meanstack\controllers\api\users.js'] === 'undefine
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: BLANKET-Error parsing instrumented code: Error: BLANKET-Error parsing instrumented code: Error: BLANKET-Error parsing instrumented code: SyntaxError: Unexpected token ILLEGAL

I cannot figure out where the issue is so I can run this test.

@theneva
Copy link

theneva commented Jun 6, 2015

You can solve this temporarily (until Blanket releases a fix) by specifying the version number of Blanket in package.json as "1.1.6" (no hat) instead of what presumably is currently "^1.1.6" or "^1.1.7".

See out alex-seville/blanket#491 for more information on this problem.

@hrasyid
Copy link

hrasyid commented Jan 1, 2016

I hit this too. For some reason "1.1.6" (or "1.1.5", or the current "^1.2.1") didn't work for me :(
Any idea?

Here's the exception:
$ mocha -R html-cov > coverage.html
D:\Codes\meanbook\node_modules\blanket\src\index.js:179
throw e;
^

Error: BLANKET-Error parsing instrumented code: Error: BLANKET-Error parsing instrumented code: Error: BLANKET-Error parsing instrumented code: SyntaxError: Unexpected token ILLEGAL
    at D:\Codes\meanbook\node_modules\blanket\src\index.js:177:37
    at Object.__dirname.blanket._blanket.instrument (D:\Codes\meanbook\node_modules\blanket\src\blanket.js:126:17)
    at Object.require.extensions..js (D:\Codes\meanbook\node_modules\blanket\src\index.js:158:25)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at C:\Users\admin\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:216:27
    at Array.forEach (native)
    at Mocha.loadFiles (C:\Users\admin\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:213:14)
    at Mocha.run (C:\Users\admin\AppData\Roaming\npm\node_modules\mocha\lib\mocha.js:453:10)
    at Object.<anonymous> (C:\Users\admin\AppData\Roaming\npm\node_modules\mocha\bin\_mocha:393:18)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants