-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(babel-transformer): respect top of the file comments/pragma
This means that the stryker mutator hooks are no longer just prepended to the beginning of file. Instead we also add the comments which means things like flow should behave correctly
- Loading branch information
Showing
12 changed files
with
171 additions
and
2 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
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,16 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-flow", | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"edge": "16", | ||
"firefox": "57", | ||
"chrome": "62", | ||
"safari": "11" | ||
} | ||
} | ||
] | ||
] | ||
} |
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,11 @@ | ||
{ | ||
"name": "flow-jest-project", | ||
"version": "0.0.0", | ||
"private": true, | ||
"description": "A module to test a flow project, see https://flow.org/", | ||
"scripts": { | ||
"test:unit": "jest", | ||
"test": "stryker run", | ||
"posttest": "mocha --no-config --require ../../tasks/ts-node-register.js verify/*.ts" | ||
} | ||
} |
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 @@ | ||
// @flow | ||
export function square(n: number): number { | ||
const result: Array<?number> = []; | ||
const cat = new Set<string>(); | ||
return n * n; | ||
} |
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,8 @@ | ||
import { square } from './square'; | ||
import { expect } from 'chai'; | ||
|
||
describe('square', () => { | ||
it('should provide 4 when given 2', () => { | ||
expect(square(2)).eq(4); | ||
}); | ||
}); |
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,13 @@ | ||
{ | ||
"$schema": "../../node_modules/@stryker-mutator/core/schema/stryker-schema.json", | ||
"reporters": [ | ||
"clear-text", | ||
"event-recorder" | ||
], | ||
"concurrency": 2, | ||
"commandRunner": { | ||
"command": "npm run test:unit" | ||
}, | ||
"symlinkNodeModules": false, | ||
"fileLogLevel": "info" | ||
} |
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,16 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-flow", | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"edge": "16", | ||
"firefox": "57", | ||
"chrome": "62", | ||
"safari": "11" | ||
} | ||
} | ||
] | ||
] | ||
} |
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,19 @@ | ||
import { expectMetrics } from '../../../helpers'; | ||
|
||
describe('After running stryker on jest-react project', () => { | ||
it('should report expected scores', async () => { | ||
await expectMetrics({ | ||
killed: 2, | ||
ignored: 0, | ||
survived: 1, | ||
mutationScore: 66.67, | ||
}); | ||
/* | ||
-----------|---------|----------|-----------|------------|----------|---------| | ||
File | % score | # killed | # timeout | # survived | # no cov | # error | | ||
-----------|---------|----------|-----------|------------|----------|---------| | ||
All files | 66.67 | 2 | 0 | 1 | 0 | 0 | | ||
square.js | 66.67 | 2 | 0 | 1 | 0 | 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
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