Browse Source

add tiny server for running tests locally

This avoids the security restrictions on web workers over file://.
pull/124/head
Braden Anderson 10 years ago
parent
commit
a90899a5f9
  1. 2
      README.md
  2. 10
      package.json
  3. 9
      tests/test.js

2
README.md

@ -67,7 +67,7 @@ For usage instructions, see the [homepage](http://papaparse.com) and, for more d @@ -67,7 +67,7 @@ For usage instructions, see the [homepage](http://papaparse.com) and, for more d
Tests
-----
Papa Parse is under test. Download this repository and open `tests/tests.html` in your browser to run them.
Papa Parse is under test. Download this repository, run `npm install`, and run `npm test` to run the tests in your browser.

10
package.json

@ -35,5 +35,13 @@ @@ -35,5 +35,13 @@
"url": "http://opensource.org/licenses/MIT"
}
],
"main": "papaparse.js"
"main": "papaparse.js",
"devDependencies": {
"connect": "^3.3.3",
"open": "0.0.5",
"serve-static": "^1.7.1"
},
"scripts": {
"test": "node tests/test.js"
}
}

9
tests/test.js

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
var connect = require('connect');
var serveStatic = require('serve-static');
var open = require('open');
var path = require('path');
connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071, function() {
open('http://localhost:8071/tests/tests.html');
console.log('Serving tests...');
});
Loading…
Cancel
Save