Skip to content
New issue

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

String literal mutator should not mutate DeclareModule node types #2399

Closed
nicojs opened this issue Aug 19, 2020 · 0 comments · Fixed by #2490
Closed

String literal mutator should not mutate DeclareModule node types #2399

nicojs opened this issue Aug 19, 2020 · 0 comments · Fixed by #2490
Labels
🐛 Bug Something isn't working
Milestone

Comments

@nicojs
Copy link
Member

nicojs commented Aug 19, 2020

Originally from @brodybits 🤟 in #2340

When I tried mutate on packages/react-devtools-extensions:

  mutate: [
    'packages/react-devtools-extensions/**/*.js',
    '!packages/react-devtools-extensions/node_modules/**/*.js',
    '!packages/react-devtools-extensions/__tests__/**/*.js',
  ],

it gave me this error:

21:01:38 (45459) ERROR Stryker an error occurred Error: Error while placing mutants of type(s) "StringLiteral" on 52:15 with conditionalExpressionMutantPlacer. TypeError: Property id of DeclareModule expected node to be of a type ["Identifier","StringLiteral"] but instead got "SequenceExpression"
    at Object.validate (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/types/lib/definitions/utils.js:132:11)
    at validateField (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/types/lib/validators/validate.js:24:9)
    at Object.validate (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/types/lib/validators/validate.js:17:3)
    at NodePath._replaceWith (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/path/replacement.js:172:7)
    at NodePath.replaceWith (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/path/replacement.js:156:8)
    at conditionalExpressionMutantPlacer (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/dist/src/mutant-placers/conditional-expression-mutant-placer.js:17:14)
    at Object.placeMutant (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/dist/src/mutant-placers/index.js:20:21)
    at exit (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/dist/src/transformers/babel-transformer.js:28:34)
    at NodePath._call (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/path/context.js:55:20)
    at NodePath.call (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/path/context.js:38:14)
    at Object.placeMutant (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/dist/src/mutant-placers/index.js:25:23)
    at exit (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/dist/src/transformers/babel-transformer.js:28:34)
    at NodePath._call (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/path/context.js:55:20)
    at NodePath.call (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/path/context.js:38:14)
    at NodePath.visit (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/path/context.js:101:8)
    at TraversalContext.visitQueue (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/context.js:112:16)
    at TraversalContext.visitSingle (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/context.js:84:19)
    at TraversalContext.visit (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/context.js:140:19)
    at Function.traverse.node (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/index.js:82:17)
    at NodePath.visit (/home/brodybits/react/node_modules/@stryker-mutator/instrumenter/node_modules/@babel/traverse/lib/path/context.js:99:18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant