I'm using sinon in my specs and including it in the Brocfile as describe in the ember-cli docs. This works and I can use sinon in my specs. But, jshint is complaining that sinon is not defined:
1 error: expected false to be truthy
AssertionError: unit/views/edit-todo-test.js should pass jshint.
unit/views/edit-todo-test.js: line 11, col 18, 'sinon' is not defined.
I can fix this by declaring sinon a global in the spec:
/* global sinon */
But, I'll have to add that to every spec (along with beforeEach
, afterEach
, etc....). I'd much rather just configure this once globally but when I add these globals to the predef
array in .jshintrc, they aren't ignored and I still get the errors. For example:
.jshintrc:
{
"predef": [
"document",
"window",
"-Promise",
"sinon"
],
<-- snip -->
still fails with the error 'sinon' is not defined.
Any help would be greatly appreciated. Thanks!
You're editing the wrong .jshintrc
file. The one located in the root directory is for the app.
There is an additional .jshintrc
file for the tests. Edit the one located at /tests/.jshintrc
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With