Skip to content

Commit

Permalink
test(setup): Setup test frameworks and adjust project accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander Koenders committed Sep 11, 2018
1 parent d8b065e commit b89ac68
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"tslint": "tslint --project tsconfig.json",
"build": "npm run tslint && tsc",
"test": "echo \"Error: no test specified\" && exit 1"
"pretest": "npm run build",
"test": "nyc --reporter=html --report-dir=reports/coverage --check-coverage --lines 80 --functions 80 --branches 75 mocha \"test/**/*Spec.js\" --exit",
"posttest": "stryker run"
},
"keywords": [
"NodeJS",
Expand All @@ -16,7 +18,21 @@
"author": "Sander Koenders",
"license": "Apache-2.0",
"devDependencies": {
"@types/chai": "^4.1.4",
"@types/express": "^4.16.0",
"@types/mocha": "^5.2.5",
"@types/sinon": "^5.0.2",
"chai": "^4.1.2",
"mocha": "^5.2.0",
"nyc": "^13.0.1",
"sinon": "^6.2.0",
"source-map-support": "^0.5.9",
"stryker": "^0.29.1",
"stryker-api": "^0.21.0",
"stryker-html-reporter": "^0.16.1",
"stryker-mocha-framework": "^0.12.1",
"stryker-mocha-runner": "^0.14.1",
"stryker-typescript": "^0.13.2",
"tslint": "^5.11.0",
"typescript": "^3.0.3"
},
Expand Down
14 changes: 14 additions & 0 deletions stryker.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = function(config) {
config.set({
testRunner: "mocha",
mutator: "typescript",
transpilers: ["typescript"],
reporters: ["html", "clear-text", "progress"],
packageManager: "npm",
testFramework: "mocha",
coverageAnalysis: "perTest",
tsconfigFile: "tsconfig.json",
mutate: ["src/**/*.ts"],
coverageAnalysis: "off"
});
};
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

// Emit metadata and allow decorators for InversifyJS
"experimentalDecorators": true,
"emitDecoratorMetadata": true
"emitDecoratorMetadata": true,

// Emit source maps and declaration files
"sourceMap": true,
"declaration": true
}
}

0 comments on commit b89ac68

Please sign in to comment.