Browse Source

Use "mocha" for node tests

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

3
package.json

@ -44,12 +44,13 @@ @@ -44,12 +44,13 @@
"connect": "^3.3.3",
"grunt": "^0.4.5",
"grunt-contrib-uglify": "^0.6.0",
"mocha": "^2.2.5",
"open": "0.0.5",
"serve-static": "^1.7.1"
},
"scripts": {
"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"
}
}

23
tests/node-tests.js

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

Loading…
Cancel
Save