diff --git a/README.md b/README.md index 6af1442..5be863c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json index 1ef6cec..5856b55 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,13 @@ "url": "http://opensource.org/licenses/MIT" } ], - "main": "papaparse.js" -} \ No newline at end of file + "main": "papaparse.js", + "devDependencies": { + "connect": "^3.3.3", + "open": "0.0.5", + "serve-static": "^1.7.1" + }, + "scripts": { + "test": "node tests/test.js" + } +} diff --git a/tests/test.js b/tests/test.js new file mode 100644 index 0000000..4961d4f --- /dev/null +++ b/tests/test.js @@ -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...'); +});