Browse Source

Use "mocha" for node tests

pull/233/head
Tobias Bieniek 10 years ago
parent
commit
6048ec6e0c
  1. 3
      package.json
  2. 11
      tests/node-tests.js

3
package.json

@ -44,12 +44,13 @@
"connect": "^3.3.3", "connect": "^3.3.3",
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-contrib-uglify": "^0.6.0", "grunt-contrib-uglify": "^0.6.0",
"mocha": "^2.2.5",
"open": "0.0.5", "open": "0.0.5",
"serve-static": "^1.7.1" "serve-static": "^1.7.1"
}, },
"scripts": { "scripts": {
"test-browser": "node tests/test.js", "test-browser": "node tests/test.js",
"test-node": "node tests/node-tests.js", "test-node": "mocha tests/node-tests.js",
"test": "npm run test-node && npm run test-browser" "test": "npm run test-node && npm run test-browser"
} }
} }

11
tests/node-tests.js

@ -37,16 +37,19 @@
assert.equal(parsedCsv.errors.length, 0) assert.equal(parsedCsv.errors.length, 0)
} }
var synchronouslyParsedCsvShouldBeCorrectlyParsed = function() { describe('PapaParse', function() {
it('synchronously parsed CSV should be correctly parsed', function() {
assertLongSampleParsedCorrectly(Papa.parse(longSampleRawCsv)); assertLongSampleParsedCorrectly(Papa.parse(longSampleRawCsv));
}(); });
var asynchronouslyParsedCsvShouldBeCorrectlyParsed = function() { it('asynchronously parsed CSV should be correctly parsed', function(done) {
Papa.parse(longSampleRawCsv, { Papa.parse(longSampleRawCsv, {
complete: function(parsedCsv) { complete: function(parsedCsv) {
assertLongSampleParsedCorrectly(parsedCsv); assertLongSampleParsedCorrectly(parsedCsv);
done();
}, },
}); });
}(); });
});
})(); })();
Loading…
Cancel
Save