Comments (21)
@alex-seville, what up brother !
from blanket.
I encountered this issue as well and reverted to 1.1.9
too to make it work.
from blanket.
I just experienced this same error. What are you reverting to version 1.9.1?
from blanket.
@westy92 npm install --save-dev [email protected]
, you may need sudo :)
from blanket.
If 1.2.1 is the latest version, how can 1.9.1 exist? Something doesn't add up. Do you mean 1.1.9?
from blanket.
@westy92 yes you're right!
from blanket.
I've published a new version, 1.2.2. Let me know if it changes anything.
from blanket.
Hm sadly I still encounter the issue with [email protected]. Here is the trace:
> mocha -r env-test -r blanket -R html-cov test/*.js > coverage.html
/Users/oncletom/workspace/freebird/feed-parser/node_modules/blanket/src/index.js:179
throw e;
^
Error: BLANKET-Error parsing instrumented code: ReferenceError: _$jscoverage is not defined
at /Users/oncletom/workspace/freebird/feed-parser/node_modules/blanket/src/index.js:177:37
at Object.__dirname.blanket._blanket.instrumentSync (/Users/oncletom/workspace/freebird/feed-parser/node_modules/blanket/src/blanket.js:134:21)
at Object.__dirname.blanket._blanket.instrument (/Users/oncletom/workspace/freebird/feed-parser/node_modules/blanket/src/blanket.js:141:22)
at Object.require.extensions..js (/Users/oncletom/workspace/freebird/feed-parser/node_modules/blanket/src/index.js:158:25)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/oncletom/workspace/freebird/feed-parser/test/parse-feed.js:3:11)
at Module._compile (module.js:410:26)
at Module._extensions..js (module.js:417:10)
at Object.require.extensions..js (/Users/oncletom/workspace/freebird/feed-parser/node_modules/blanket/src/index.js:144:17)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at /Users/oncletom/workspace/freebird/feed-parser/node_modules/mocha/lib/mocha.js:219:27
at Array.forEach (native)
at Mocha.loadFiles (/Users/oncletom/workspace/freebird/feed-parser/node_modules/mocha/lib/mocha.js:216:14)
at Mocha.run (/Users/oncletom/workspace/freebird/feed-parser/node_modules/mocha/lib/mocha.js:468:10)
at Object.<anonymous> (/Users/oncletom/workspace/freebird/feed-parser/node_modules/mocha/bin/_mocha:403:18)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3
And a partial npm ls
:
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
from blanket.
+1
from blanket.
Hmm, it's working on travis CI at [email protected] - https://travis-ci.org/alex-seville/blanket/jobs/110242642
from blanket.
Same issue here when trying to use "use strict";
at the top of some of my project files using blanket 1.2.2.
A very simple example of this:
test.js:
let abc = 123;
Error: BLANKET-Error parsing instrumented code: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Fine, so I add use strict:
test.js:
'use strict';
let abc = 123;
And the output:
# mocha --require blanket test.js
/Volumes/workspace/sss/mobile-api/node_modules/blanket/src/index.js:179
throw e;
^
Error: BLANKET-Error parsing instrumented code: ReferenceError: _$jscoverage is not defined
at /Volumes/workspace/sss/mobile-api/node_modules/blanket/src/index.js:177:37
at Object.__dirname.blanket._blanket.instrumentSync (/Volumes/workspace/sss/mobile-api/node_modules/blanket/src/blanket.js:134:21)
at Object.__dirname.blanket._blanket.instrument (/Volumes/workspace/sss/mobile-api/node_modules/blanket/src/blanket.js:141:22)
at Object.require.extensions..js (/Volumes/workspace/sss/mobile-api/node_modules/blanket/src/index.js:158:25)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at /Volumes/workspace/sss/mobile-api/node_modules/mocha/lib/mocha.js:219:27
at Array.forEach (native)
at Mocha.loadFiles (/Volumes/workspace/sss/mobile-api/node_modules/mocha/lib/mocha.js:216:14)
at Mocha.run (/Volumes/workspace/sss/mobile-api/node_modules/mocha/lib/mocha.js:468:10)
at Object.<anonymous> (/Volumes/workspace/sss/mobile-api/node_modules/mocha/bin/_mocha:403:18)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:141:18)
at node.js:933:3
Snippet from my package.json:
"blanket": {
"pattern": "///[\\w-_]+\\.js$/",
"data-cover-never": [
"/node_modules/",
"/test/"
],
"data-cover-ecmaVersion": 6,
"data-cover-reporter-options": {
"relativepath": true
}
}
Tested on various versions of Node 4 and 5.
from blanket.
Sounds like you're using ES6, you'll need to let Blanket know:
https://github.com/alex-seville/blanket/blob/master/docs/options.md#data-cover-ecmaversion
from blanket.
I have already let Blanket know I'm using ES6. See the snippet from my package.json above which has the "data-cover-ecmaVersion": 6
parameter.
We are using ES6 throughout our codebase but have had to wrap most ES6 files in a function wrapper to get Blanket to work. This doesn't work for top-level files however such as app.js. As soon as I add "use strict";
to this I get this error so we are unable to use ES6 features in these files.
I can reproduce this in a simple example:
test.js:
var abc = 123;
mocha --require blanket test.js
0 passing (2ms)
However:
test.js:
'use strict';
var abc = 123;
# mocha --require blanket test.js
/usr/local/lib/node_modules/blanket/src/index.js:179
throw e;
^
Error: BLANKET-Error parsing instrumented code: ReferenceError: _$jscoverage is not defined
at /usr/local/lib/node_modules/blanket/src/index.js:177:37
at Object.__dirname.blanket._blanket.instrumentSync (/usr/local/lib/node_modules/blanket/src/blanket.js:134:21)
at Object.__dirname.blanket._blanket.instrument (/usr/local/lib/node_modules/blanket/src/blanket.js:141:22)
at Object.require.extensions..js (/usr/local/lib/node_modules/blanket/src/index.js:158:25)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at /usr/local/lib/node_modules/mocha/lib/mocha.js:219:27
at Array.forEach (native)
at Mocha.loadFiles (/usr/local/lib/node_modules/mocha/lib/mocha.js:216:14)
at Mocha.run (/usr/local/lib/node_modules/mocha/lib/mocha.js:468:10)
at Object.<anonymous> (/usr/local/lib/node_modules/mocha/bin/_mocha:403:18)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:141:18)
at node.js:933:3
from blanket.
This is has been around for a long time, originally report Dec.2013.
I need to run npm install [email protected] to make my tests run.
from blanket.
Same problem here (_$jscoverage is not defined
) when using 1.2.1 or 1.2.2. Reverting back to 1.1.9 as workaround.
from blanket.
Same with me...
from blanket.
Same with me...
from blanket.
Same here. Busted. We absolutely need ecmaVersion 6. Tried going to a lower version and other problems occur because of no ecmaVersion 6 support.
from blanket.
I'm having the same problem when using ES6. Running 1.1.9 causes another problem:
Error: BLANKET-Error parsing instrumented code: Error: BLANKET-Error parsing instrumented code: Error: BLANKET-Error parsing instrumented code: Error: Line 17: Unexpected token )
Anyone has a solution?
from blanket.
I'm having this problem too with blanket 1.2.3
from blanket.
I too am having this problem with 1.2.3 using es6
> [email protected] test /Users/ds/Dev/nylon-web
> multi='dot=- html-cov=coverage.html' ./node_modules/mocha/bin/mocha -r blanket --reporter mocha-multi --no-colors "src/app/app.js"
/Users/ds/Dev/nylon-web/node_modules/blanket/src/index.js:180
throw e;
^
Error: BLANKET-Error parsing instrumented code: ReferenceError: _$jscoverage is not defined
at /Users/ds/Dev/nylon-web/node_modules/blanket/src/index.js:178:37
at Object.__dirname.blanket._blanket.instrumentSync (/Users/ds/Dev/nylon-web/node_modules/blanket/src/blanket.js:134:21)
at Object.__dirname.blanket._blanket.instrument (/Users/ds/Dev/nylon-web/node_modules/blanket/src/blanket.js:141:22)
at Object.require.extensions..js (/Users/ds/Dev/nylon-web/node_modules/blanket/src/index.js:159:25)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at /Users/ds/Dev/nylon-web/node_modules/mocha/lib/mocha.js:222:27
at Array.forEach (native)
at Mocha.loadFiles (/Users/ds/Dev/nylon-web/node_modules/mocha/lib/mocha.js:219:14)
at Mocha.run (/Users/ds/Dev/nylon-web/node_modules/mocha/lib/mocha.js:487:10)
at Object.<anonymous> (/Users/ds/Dev/nylon-web/node_modules/mocha/bin/_mocha:459:18)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:148:18)
at node.js:405:3
from blanket.
Related Issues (20)
- Commented on: Not seeing any reports - noob alert #244 HOT 1
- Reason for replacing ".js" with ""
- In ploymer,the script is written in the component html,is there any method to set data-cover on the script HOT 2
- Publish the latest version HOT 1
- Global object replaced on QUnit test
- How to use Blanket.js in test files loaded with Require.js? HOT 2
- blanket js does not given correct results.
- Can blanket handle source maps?
- documention is wrong for using with mocha HOT 1
- Advice on how to use with WebDriver. HOT 1
- Support for phantomjs 2.1.1 (for blanket to work on ppc64le architecture)
- Coverage for hoisted vars HOT 2
- I am getting Error: invalid reporter "html-cov" HOT 1
- Tests stop running on upgrading to [email protected] HOT 1
- make a new release on the github?
- Instrumentation affects test results.
- Running Jasmine Code Coverage using command Line
- Deprecate this?
- Hi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blanket.