-
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(String literal mutator): Don't mutate export declarations
- Loading branch information
Showing
4 changed files
with
28 additions
and
2 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
20 changes: 19 additions & 1 deletion
20
packages/stryker-typescript/test/unit/mutator/StringLiteralMutatorSpec.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 |
---|---|---|
@@ -1,5 +1,23 @@ | ||
import { verifySpecification } from './mutatorAssertions'; | ||
import { verifySpecification, expectMutation } from './mutatorAssertions'; | ||
import StringLiteralMutator from '../../../src/mutator/StringLiteralMutator'; | ||
import StringLiteralMutatorSpec from 'stryker-mutator-specification/src/StringLiteralMutatorSpec'; | ||
import NodeMutator from '../../../src/mutator/NodeMutator'; | ||
|
||
verifySpecification(StringLiteralMutatorSpec, StringLiteralMutator); | ||
|
||
describe('StringLiteralMutator - Extras', () => { | ||
|
||
let mutator: NodeMutator; | ||
before(() => { | ||
mutator = new StringLiteralMutator(); | ||
}); | ||
|
||
it('should not mutate module declarations', () => { | ||
expectMutation(mutator, 'declare module "new-foo-module";'); | ||
expectMutation(mutator, 'declare module "*!foo" { }'); | ||
}); | ||
|
||
it('should not mutate `import = require()` statements', () => { | ||
expectMutation(mutator, 'import foo = require("foo");'); | ||
}); | ||
}); |