I have installed jasmine-node using npm. My project's directory structure are following:
|-lib\
|-taxCalc.js
|-spec\
|-taxCalc.spec.coffee
|-taxCalc.spec.js
|-src\
|-taxCalc.coffee
When I run jasmine-node from root folder with following command (for CoffeeScript):
jasmine-node --coffee --verbose spec
Finished in 0.015 seconds
0 tests, 0 assertions, 0 failures
Same if I run JavaScript version.
If I explicitly point to spec file tests 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
Documentation says that file names should end with 'spec.js' or 'spec.coffee', so everything seems ok.
P.S. I am running on Windows 7.
We can install Jasmine for node. js by running npm install jasmine-node -g . We provide the -g option to install it globally, so we're able to run jasmine-node from the command line.
Setting up JasmineGive your code access to Jasmine, downloading it manually or with a package manager. Initialize Jasmine. Create a spec (test) file. Make the source code available to your spec file.
NODE AND BROWSER Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests. Get Started.
Jasmine-node has been updated in the last week to use walkdir instead of findit which now makes it function in windows. Re-run npm install jasmine-node
for the update.
Stumbled upon the same problem and have read MarisKs link too late :/ - but came to the same conclusion as described in the issue: At least on Windows 7, file.stat.ino returns always 0, so the function createInodeChecker() in findit/index.js returns always true and the file will be skipped.
Easiest on-the-fly-fix: edit createInodeChecker to
function createInodeChecker() {
var inodes = {};
return function inodeSeen(inode) {
if (inode == 0) {
return false;
}
if (inodes[inode]) {
return true;
} else {
inodes[inode] = true;
return false;
}
}
}
Not nice, but you can work with it.
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