juanfran / gulp-scss-lint

Gulp plugin to lint scss files with `scss-lint`
113 stars 33 forks source link

Tests fail on my system #20

Closed webgefrickel closed 9 years ago

webgefrickel commented 9 years ago

When debugging the plugin for my latest pull request, I could not get the tests to run. (I ran gem install bundler && bundle install first, of course):


~/Sites/newdev/node_modules/gulp-scss-lint debug-option*  9s
❯ npm run test

> gulp-scss-lint@0.1.5 test /Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint
> mocha

  [18:45:19] 4 issues found in ./test/fixtures/invalid.scss
[18:45:19] ./test/fixtures/invalid.scss:1 [W] Avoid using id selectors
[18:45:19] ./test/fixtures/invalid.scss:2 [W] Line should be indented 2 spaces, but was indented 0 spaces
[18:45:19] ./test/fixtures/invalid.scss:2 [W] Empty rule
[18:45:19] ./test/fixtures/invalid.scss:3 [W] Files should end with a trailing newline
․․[18:45:20] 4 issues found in ./test/fixtures/invalid.scss
[18:45:20] ./test/fixtures/invalid.scss:1 [W] Avoid using id selectors
[18:45:20] ./test/fixtures/invalid.scss:2 [W] Line should be indented 2 spaces, but was indented 0 spaces
[18:45:20] ./test/fixtures/invalid.scss:2 [W] Empty rule
[18:45:20] ./test/fixtures/invalid.scss:3 [W] Files should end with a trailing newline
․[18:45:20] 1 issues found in ./test/fixtures/valid.scss
[18:45:20] ./test/fixtures/valid.scss:1 [W] Avoid using id selectors
․․․․[18:45:22] 4 issues found in ./test/fixtures/invalid.scss
[18:45:22] ./test/fixtures/invalid.scss:1 [W] Avoid using id selectors
[18:45:22] ./test/fixtures/invalid.scss:2 [W] Line should be indented 2 spaces, but was indented 0 spaces
[18:45:22] ./test/fixtures/invalid.scss:2 [W] Empty rule
[18:45:22] ./test/fixtures/invalid.scss:3 [W] Files should end with a trailing newline
․․[18:45:23] 1 issues found in ./test/fixtures/file with spaces.scss
[18:45:23] ./test/fixtures/file with spaces.scss:1 [W] Avoid using id selectors
․[18:45:23] 2 issues found in ./test/fixtures/valid.scss
[18:45:23] ./test/fixtures/valid.scss:1 [W] Avoid using id selectors
[18:45:23] ./test/fixtures/valid.scss:2 [W] Line should be indented 4 spaces, but was indented 2 spaces
․․[18:45:24] 4 issues found in ./test/fixtures/invalid.scss
[18:45:24] ./test/fixtures/invalid.scss:1 [W] Avoid using id selectors
[18:45:24] ./test/fixtures/invalid.scss:2 [W] Line should be indented 2 spaces, but was indented 0 spaces
[18:45:24] ./test/fixtures/invalid.scss:2 [W] Empty rule
[18:45:24] ./test/fixtures/invalid.scss:3 [W] Files should end with a trailing newline
․․․․․․

  14 passing (6s)
  4 failing

  1) gulp-scss-lint invalid scss file:
     Uncaught AssertionError: expected [ Array(4) ] to have a length of 3 but got 4
      at Stream.<anonymous> (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/test/main.js:28:46)
      at Stream.emit (events.js:95:17)
      at reportLint (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:156:16)
      at Parser.<anonymous> (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:384:20)
      at Parser.emit (events.js:95:17)
      at Object.onclosetag (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:348:26)
      at emit (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
      at emitNode (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
      at closeTag (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
      at Object.write (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
      at Parser.exports.Parser.Parser.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:403:31)
      at Parser.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:6:61)
      at exports.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:433:19)
      at formatCommandResult (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:99:5)
      at /Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:89:9
      at ChildProcess.exithandler (child_process.js:662:7)
      at ChildProcess.emit (events.js:98:17)
      at maybeClose (child_process.js:766:16)
      at Socket.<anonymous> (child_process.js:979:11)
      at Socket.emit (events.js:95:17)
      at Pipe.close (net.js:466:12)

  2) gulp-scss-lint validate multi scss files:
     Uncaught AssertionError: expected [ Array(4) ] to have a length of 3 but got 4
      at Stream.<anonymous> (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/test/main.js:92:46)
      at Stream.emit (events.js:95:17)
      at reportLint (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:156:16)
      at Parser.<anonymous> (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:384:20)
      at Parser.emit (events.js:95:17)
      at Object.onclosetag (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:348:26)
      at emit (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
      at emitNode (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
      at closeTag (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
      at Object.write (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
      at Parser.exports.Parser.Parser.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:403:31)
      at Parser.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:6:61)
      at exports.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:433:19)
      at formatCommandResult (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:99:5)
      at /Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:89:9
      at ChildProcess.exithandler (child_process.js:662:7)
      at ChildProcess.emit (events.js:98:17)
      at maybeClose (child_process.js:766:16)
      at Socket.<anonymous> (child_process.js:979:11)
      at Socket.emit (events.js:95:17)
      at Pipe.close (net.js:466:12)

  3) gulp-scss-lint valid scss file:
     Uncaught AssertionError: expected false to be true

  4) gulp-scss-lint should not fail with files with spaces:
     Uncaught AssertionError: expected false to be true

npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v0.10.35
npm ERR! npm  v2.2.0
npm ERR! code ELIFECYCLE
npm ERR! gulp-scss-lint@0.1.5 test: `mocha`
npm ERR! Exit status 4
npm ERR!
npm ERR! Failed at the gulp-scss-lint@0.1.5 test script 'mocha'.
npm ERR! This is most likely a problem with the gulp-scss-lint package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mocha
npm ERR! You can get their info via:
npm ERR!     npm owner ls gulp-scss-lint
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/npm-debug.log

I am just getting my head wrapped around mocha/chai — I am sorry that I cannot give you more input on this...

BTW: the dependencies seem to be pretty outdated


~/Sites/newdev/node_modules/gulp-scss-lint debug-option*  10s
❯ npm-check-updates

"dargs" can be updated from ~0.1.0 to ~3.0.0 (Installed: 0.1.0, Latest: 3.0.0)
"event-stream" can be updated from ~3.1.2 to ~3.2.1 (Installed: 3.1.7, Latest: 3.2.1)
"gulp-util" can be updated from ~2.2.14 to ~3.0.2 (Installed: 2.2.20, Latest: 3.0.2)
"chai" can be updated from ~1.9.1 to ~1.10.0 (Installed: 1.9.2, Latest: 1.10.0)
"mocha" can be updated from ~1.18.2 to ~2.1.0 (Installed: 1.18.2, Latest: 2.1.0)
"proxyquire" can be updated from ^1.0.1 to ^1.3.1 (Installed: 1.3.1, Latest: 1.3.1)
"sinon" can be updated from ^1.10.2 to ^1.12.2 (Installed: 1.12.2, Latest: 1.12.2)

Run with '-u' to upgrade your package.json
juanfran commented 9 years ago

thanks @webgefrickel

the error was because i'm using an old scss-lint version for the test which gave a different result. I've updated scss-lint and all the dependencies

webgefrickel commented 9 years ago

Nice :-) Checked out current master and tests are running fine with bundle exec npm run test. Thanks!