Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(instrumenter): only add header when there are mutats (#2503)
Only add the JS header for files that have mutants. For example: don't add it in *.d.ts files.
- Loading branch information
Showing
7 changed files
with
38 additions
and
166 deletions.
There are no files selected for viewing
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
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
56 changes: 1 addition & 55 deletions
56
packages/instrumenter/testResources/instrumenter/flow-typed.js.out.snap
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
56 changes: 1 addition & 55 deletions
56
packages/instrumenter/testResources/instrumenter/ts-declarations.ts.out.snap
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 |
---|---|---|
@@ -1,61 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`instrumenter integration type declarations should not produce mutants for a TS declaration file 1`] = ` | ||
"function stryNS_9fa48() { | ||
var g = new Function(\\"return this\\")(); | ||
var ns = g.__stryker__ || (g.__stryker__ = {}); | ||
if (ns.activeMutant === undefined && g.process && g.process.env && g.process.env.__STRYKER_ACTIVE_MUTANT__) { | ||
ns.activeMutant = Number(g.process.env.__STRYKER_ACTIVE_MUTANT__); | ||
} | ||
function retrieveNS() { | ||
return ns; | ||
} | ||
stryNS_9fa48 = retrieveNS; | ||
return retrieveNS(); | ||
} | ||
stryNS_9fa48(); | ||
function stryCov_9fa48() { | ||
var ns = stryNS_9fa48(); | ||
var cov = ns.mutantCoverage || (ns.mutantCoverage = { | ||
static: {}, | ||
perTest: {} | ||
}); | ||
function cover() { | ||
var c = cov.static; | ||
if (ns.currentTestId) { | ||
c = cov.perTest[ns.currentTestId] = cov.perTest[ns.currentTestId] || {}; | ||
} | ||
var a = arguments; | ||
for (var i = 0; i < a.length; i++) { | ||
c[a[i]] = (c[a[i]] || 0) + 1; | ||
} | ||
} | ||
stryCov_9fa48 = cover; | ||
cover.apply(null, arguments); | ||
} | ||
function stryMutAct_9fa48(id) { | ||
var ns = stryNS_9fa48(); | ||
function isActive(id) { | ||
return ns.activeMutant === id; | ||
} | ||
stryMutAct_9fa48 = isActive; | ||
return isActive(id); | ||
} | ||
export declare const globalNamespace = \\"globalNamespace\\"; | ||
"export declare const globalNamespace = \\"globalNamespace\\"; | ||
declare function foo(): 'foo'; | ||
declare module 'express' {}" | ||
`; |
56 changes: 1 addition & 55 deletions
56
packages/instrumenter/testResources/instrumenter/type-definitions.ts.out.snap
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