Skip to content

Commit b3fc2fd

Browse files
committed
test(mocha): add test:watch script
that clears console before each test run
1 parent 7dba409 commit b3fc2fd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"copy-flow-files": "cd src; copy *.js.flow **/*.js.flow ../lib",
1515
"build": "rimraf lib && babel src --out-dir lib",
1616
"test": "NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
17+
"test:watch": "mocha --watch $npm_package_config_mocha",
1718
"commitmsg": "validate-commit-msg",
1819
"precommit": "npm run lint && flow",
1920
"prepush": "npm test",

test/clearConsole.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* eslint-env node */
2+
3+
if (process.argv.indexOf('--watch') >= 0) {
4+
before(() => process.stdout.write('\u001b[2J\u001b[1;1H\u001b[3J'))
5+
}
6+

0 commit comments

Comments
 (0)