Skip to content

Commit

Permalink
build(test) Improve test target
Browse files Browse the repository at this point in the history
Adds a mocha section to package.json to allow the removal of the
file path arguments in the test script target for mocha. Doing this
enables the developer to now invoke testing on a single file more
easily like so:

`$ npm test test/utils.test.js`
  • Loading branch information
stieg committed Nov 11, 2019
1 parent e9c69b3 commit 9e31710
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package.json
Expand Up @@ -73,7 +73,7 @@
"lint": "eslint .",
"release": "git pull && git push origin master --tags && npm publish",
"release-legacy": "git pull origin 4.x && git push origin 4.x --tags && npm publish --tag legacy",
"test": "mocha --exit test/*.test.js test/**/*.test.js",
"test": "mocha --exit",
"test-cov": "nyc --reporter=html --reporter=text npm test"
},
"main": "./index.js",
Expand Down Expand Up @@ -142,6 +142,10 @@
"message": "Don't use Mocha's global context"
}
]
},
"mocha": {
"extension": ["test.js"],
"watch-files": ["test/**/*.js"]
}
}
}

0 comments on commit 9e31710

Please sign in to comment.