-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mocha): deprecate mocha < v6 (#2379)
BREAKING CHANGE: Mocha@<6 is deprecated and support for it will be removed in Stryker v5
- Loading branch information
Showing
9 changed files
with
278 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "mocha-old-version", | ||
"version": "0.0.0", | ||
"private": true, | ||
"description": "A test package for mocha 5", | ||
"main": "index.js", | ||
"scripts": { | ||
"pretest": "rimraf \"reports\"", | ||
"test": "stryker run", | ||
"posttest": "mocha --no-config --require ../../tasks/ts-node-register.js verify/*.ts" | ||
}, | ||
"localDependencies": { | ||
"@stryker-mutator/api": "../../../packages/api", | ||
"@stryker-mutator/core": "../../../packages/core", | ||
"@stryker-mutator/instrumenter": "../../../packages/instrumenter", | ||
"@stryker-mutator/mocha-runner": "../../../packages/mocha-runner", | ||
"@stryker-mutator/util": "../../../packages/util" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"mocha": "^5.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports.add = function(num1, num2) { | ||
return num1 + num2; | ||
}; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "../../node_modules/@stryker-mutator/core/schema/stryker-schema.json", | ||
"testRunner": "mocha", | ||
"concurrency": 1, | ||
"coverageAnalysis": "off", | ||
"reporters": ["clear-text", "html", "event-recorder"], | ||
"mochaOptions": { | ||
"spec": ["test/**/*.js"] | ||
}, | ||
"fileLogLevel": "info", | ||
"plugins": [ | ||
"@stryker-mutator/mocha-runner" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { add } = require('../../src/add'); | ||
const { expect } = require('chai'); | ||
|
||
describe('add', () => { | ||
|
||
it('2 + 3 = 5', () => { | ||
expect(add(2, 3)).to.be.equal(5); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { promises as fs } from 'fs'; | ||
import { expect } from 'chai'; | ||
import { it } from 'mocha'; | ||
|
||
describe('Verify stryker runs with mocha < 6', () => { | ||
|
||
let strykerLog: string; | ||
|
||
before(async () => { | ||
strykerLog = await fs.readFile('./stryker.log', 'utf8'); | ||
}); | ||
|
||
it('should warn about old mocha version', async () => { | ||
expect(strykerLog).contains('DEPRECATED: Mocha < 6 detected. Please upgrade to at least Mocha version 6. Stryker will drop support for Mocha < 6 in V5'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters