testing
Exposes testing frameworks for other modules to use in this project.
Currently using Mocha, Chai and TS-Node.
nyc and coveralls is used for code coverage.
source-map-support added for compatibility.
Sample test script to put into package.json:
{
"scripts": {
"test": "nyc mocha -r ts-node/register src/**/*.spec.ts --require source-map-support/register" ,
"coverage": "nyc report --reporter=text-lcov | coveralls"
},
}
Sample .travis.yml file:
language: node_js
node_js:
- "node"
cache:
directories:
- "node_modules"
after_success: npm run coverage
Sample .nycrc file:
{
"extension": [
".ts"
],
"require": [
"ts-node/register"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"**/*.d.ts",
"**/*.spec.ts"
],
"reporter": [
"text-summary",
"html"
],
"sourceMap": true,
"instrument": true
}