We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stryker 4.0.0 fails to mutate typescript classes with string variable names.
07:54:42 (3876) ERROR Stryker SyntaxError: expressionMutantPlacer could not place mutants with type(s): "StringLiteral". Either remove this file from the list of files to be mutated, or ignore the mutators. Please report this issue at https://github.com/stryker-mutator/stryker/issues/new?assignees=&labels=%F0%9F%90%9B+Bug&template=bug_report.md&title=expressionMutantPlacer%20could%20not%20place%20mutants%20with%20type(s)%3A%20%22StringLiteral%22. 1 | export class ClassA{
2 | public readonly 'variable-name': boolean = true | ^^^^^^^^^^^^^^^^^^^^^^^^^ 5 | }
stryker.config.js: module.exports = { mutate: [ '/*.ts', '!/.spec.ts', '!**/.mock.ts', '!/*.config.ts', '!/.enum.ts', '!**/.const.ts', '!jest.setup.ts' ], packageManager: 'npm', reporters: ['clear-text', 'progress', 'html'], testRunner: 'jest', jest: { enableFindRelatedTests: true, config: { preset: 'ts-jest', testEnvironment: 'node', resetModules: true, setupFilesAfterEnv: ['jest-extended', ${process.cwd()}/jest.setup.ts], testPathIgnorePatterns: ['/dist/', '/node_modules/'] } }, thresholds: { high: 100, low: 80, break: 100 }, coverageAnalysis: 'off', tsconfigFile: 'tsconfig.json', htmlReporter: { baseDir: 'reports/coverage/mutation' }, timeoutMS: 60000 }
${process.cwd()}/jest.setup.ts
jest.config.js: module.exports = { preset: 'ts-jest', testEnvironment: 'node', setupFilesAfterEnv: ['jest-extended', './jest.setup.ts'], testPathIgnorePatterns: ['/.stryker-tmp/', '/dist/', '/node_modules/'], coverageDirectory: 'reports/coverage/unit', collectCoverageFrom: ['src//*.ts', '!/runner.ts'], coverageThreshold: { global: { branches: 100, functions: 100, lines: 100, statements: 100 } }, reporters: [ 'default', [ 'jest-junit', { outputDirectory: '/reports/tests', outputName: 'unit-test-evidence.xml' } ], [ './node_modules/jest-html-reporter', { outputPath: 'reports/cucumber/requirements-evidence.html' } ] ] }
The text was updated successfully, but these errors were encountered:
Wow! Great find.
class A { public readonly 'variable-name': boolean = true }
Didn't know this was valid code 😅
Should be an easy fix.
Sorry, something went wrong.
yeaa... come edge cases can be really tricky :)
Glad I spent time polishing that error message.
Successfully merging a pull request may close this issue.
Stryker 4.0.0 fails to mutate typescript classes with string variable names.
07:54:42 (3876) ERROR Stryker SyntaxError: expressionMutantPlacer could not place mutants with type(s): "StringLiteral". Either remove this file from the list of files to be mutated, or ignore the mutators. Please report this issue at https://github.com/stryker-mutator/stryker/issues/new?assignees=&labels=%F0%9F%90%9B+Bug&template=bug_report.md&title=expressionMutantPlacer%20could%20not%20place%20mutants%20with%20type(s)%3A%20%22StringLiteral%22.
1 | export class ClassA{
stryker.config.js:
module.exports = {
mutate: [
'/*.ts',
'!/.spec.ts',
'!**/.mock.ts',
'!/*.config.ts',
'!/.enum.ts',
'!**/.const.ts',
'!jest.setup.ts'
],
packageManager: 'npm',
reporters: ['clear-text', 'progress', 'html'],
testRunner: 'jest',
jest: {
enableFindRelatedTests: true,
config: {
preset: 'ts-jest',
testEnvironment: 'node',
resetModules: true,
setupFilesAfterEnv: ['jest-extended',
${process.cwd()}/jest.setup.ts
],testPathIgnorePatterns: ['/dist/', '/node_modules/']
}
},
thresholds: { high: 100, low: 80, break: 100 },
coverageAnalysis: 'off',
tsconfigFile: 'tsconfig.json',
htmlReporter: {
baseDir: 'reports/coverage/mutation'
},
timeoutMS: 60000
}
jest.config.js:
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFilesAfterEnv: ['jest-extended', './jest.setup.ts'],
testPathIgnorePatterns: ['/.stryker-tmp/', '/dist/', '/node_modules/'],
coverageDirectory: 'reports/coverage/unit',
collectCoverageFrom: ['src//*.ts', '!/runner.ts'],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100
}
},
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: '/reports/tests',
outputName: 'unit-test-evidence.xml'
}
],
[
'./node_modules/jest-html-reporter',
{
outputPath: 'reports/cucumber/requirements-evidence.html'
}
]
]
}
The text was updated successfully, but these errors were encountered: