Add testing section to README
This commit is contained in:
@@ -202,6 +202,15 @@ Then open http://127.0.0.1:3000 in a web browser to access the demo.
|
|||||||
|
|
||||||
*Note: Do not use ConEmu, as it seems to break the demo for some reason.*
|
*Note: Do not use ConEmu, as it seems to break the demo for some reason.*
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
Tests are run using the following npm scripts:
|
||||||
|
|
||||||
|
- `npm test`: This will run both unit tests and the linter
|
||||||
|
- `npm run test-suite <file>`: This will run all tests within a particular file, <file> is the test file name excluding the extension (eg. "Linkifier.test")
|
||||||
|
- `npm run test-debug`: This will run unit tests with `--inspect-brk`, this can then be automatically debugged using [VS Code auto attach](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_auto-attach-feature) or manually attached to by a debugger
|
||||||
|
- `npm run lint`: This will run the linter only
|
||||||
|
|
||||||
## Releases
|
## Releases
|
||||||
|
|
||||||
Xterm.js follows a monthly release cycle roughly.
|
Xterm.js follows a monthly release cycle roughly.
|
||||||
|
|||||||
+3
-3
@@ -163,10 +163,10 @@ gulp.task('mocha-coverage', ['instrument-test'], function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run single test file by file name(without file extension). Example of the command:
|
* Run single test suite (file) by file name (without file extension). Example of the command:
|
||||||
* gulp mocha-test --test InputHandler.test
|
* gulp mocha-suite --test InputHandler.test
|
||||||
*/
|
*/
|
||||||
gulp.task('mocha-test', [], function () {
|
gulp.task('mocha-suite', [], function () {
|
||||||
let testName = util.env.test;
|
let testName = util.env.test;
|
||||||
util.log("Run test by Name: " + testName);
|
util.log("Run test by Name: " + testName);
|
||||||
return gulp.src([`${outDir}/${testName}.js`, `${outDir}/**/${testName}.js`], {read: false})
|
return gulp.src([`${outDir}/${testName}.js`, `${outDir}/**/${testName}.js`], {read: false})
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
"lint": "tslint src/*.ts src/**/*.ts",
|
"lint": "tslint src/*.ts src/**/*.ts",
|
||||||
"test": "npm-run-all mocha lint",
|
"test": "npm-run-all mocha lint",
|
||||||
"test-debug": "node --inspect-brk node_modules/.bin/gulp test",
|
"test-debug": "node --inspect-brk node_modules/.bin/gulp test",
|
||||||
|
"test-suite": "gulp mocha-suite --test",
|
||||||
"mocha": "gulp test",
|
"mocha": "gulp test",
|
||||||
"build:docs": "jsdoc -c jsdoc.json",
|
"build:docs": "jsdoc -c jsdoc.json",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
|
|||||||
Reference in New Issue
Block a user