Why doesn't jasmine-node find my spec files?

I installed jasmine-node using npm. The structure of my project is as follows:

|-lib\ |-taxCalc.js |-spec\ |-taxCalc.spec.coffee |-taxCalc.spec.js |-src\ |-taxCalc.coffee 

When I run jasmine-node from the root folder with the following command (for CoffeeScript):

 jasmine-node --coffee --verbose spec Finished in 0.015 seconds 0 tests, 0 assertions, 0 failures 

Same thing if I run the JavaScript version.

If I explicitly state that the tests for special files run fine:

 jasmine-node --coffee --verbose spec/taxCalc.spec.coffee Tax calculation calculates tax Finished in 0.009 seconds 1 test, 1 assertion, 0 failures 

The documentation says that the file names should end in "spec.js" or "spec.coffee", so everything looks fine.

PS I am running on Windows 7.

+7
source share
2 answers

I came across the same problem and read the MarisKs link too late: / - but came to the same conclusion as described in the release: At least in Windows 7, file.stat.ino always returns 0, so the createInodeChecker () function in findit / index.js always returns true and the file will be skipped.

The easiest on the fly fix: edit createInodeChecker on

 function createInodeChecker() { var inodes = {}; return function inodeSeen(inode) { if (inode == 0) { return false; } if (inodes[inode]) { return true; } else { inodes[inode] = true; return false; } } } 

Do not like it, but you can work with it.

+2
source

Jasmine - node was updated last week to use walkdir instead of findit, which now makes it a function in windows. Run npm install jasmine-node again to update.

+3
source

All Articles