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

Mutator of Array constructor without new missing for TypeScript #1902

Closed
brodybits opened this issue Nov 29, 2019 · 1 comment · Fixed by #1903
Closed

Mutator of Array constructor without new missing for TypeScript #1902

brodybits opened this issue Nov 29, 2019 · 1 comment · Fixed by #1903
Labels
🐛 Bug Something isn't working

Comments

@brodybits
Copy link

Summary

The following test updates show Array constructor mutator that is missing for TypeScript:

--- a/packages/mutator-specification/src/ArrayDeclarationMutatorSpec.ts
+++ b/packages/mutator-specification/src/ArrayDeclarationMutatorSpec.ts
@@ -20,6 +20,9 @@ export default function ArrayDeclarationMutatorSpec(name: string, expectMutation
     it('should mutate filled Array constructor calls as empty arrays', () => {
       expectMutation('new Array(a, 1 + 1)', 'new Array()');
       expectMutation("new Array('val')", 'new Array()');
+      // XXX known issue on TypeScript mutator:
+      expectMutation("Array('val')", 'Array()');
+      expectMutation('Array(a, 1 + 1)', 'Array()');
     });
 
     it('should not mutate other new expressions', () => {
@@ -29,6 +32,8 @@ export default function ArrayDeclarationMutatorSpec(name: string, expectMutation
 
     it('should mutate empty array constructor call as a filled array', () => {
       expectMutation('new Array()', 'new Array([])');
+      // XXX known issue on TypeScript mutator:
+      expectMutation('Array()', 'Array([])');
     });
   });
 }

Stryker config

see https://github.com/stryker-mutator/stryker/blob/master/packages/javascript-mutator/stryker.conf.js

Test runner config

see https://github.com/stryker-mutator/stryker/blob/master/packages/javascript-mutator/package.json

Stryker environment

see https://github.com/stryker-mutator/stryker/blob/master/packages/javascript-mutator/package.json

Test runner environment

see https://github.com/stryker-mutator/stryker/blob/master/packages/javascript-mutator/package.json

Your Environment

software version(s)
node 12.13.1
npm 6.12.1
Operating System Linux, macOS

Add stryker.log

@brodybits brodybits added the 🐛 Bug Something isn't working label Nov 29, 2019
@brodybits brodybits changed the title Array constructor mutator missing for TypeScript Mutator of Array constructor without new missing for TypeScript Nov 29, 2019
brodybits pushed a commit to brodybits/stryker that referenced this issue Nov 29, 2019
@bartekleon
Copy link
Member

Nice catch!

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.

2 participants