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

test: setup stryker mutation testing #183

Closed
wants to merge 1 commit into from

Conversation

ChristianMurphy
Copy link
Member

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

Adds Stryker as a mutation testing tool, which tests the tests, by making breaking changes in the source code, and see if the tests still pass.

@ChristianMurphy ChristianMurphy added 🕸️ area/tests This affects tests 🛠 blocked/wip This cannot progress yet, it’s being worked on labels Dec 31, 2021
@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Dec 31, 2021
@ChristianMurphy
Copy link
Member Author

ChristianMurphy commented Dec 31, 2021

initial results
All tests
  ✓ All tests (killed 306)

#10. [Survived] BooleanLiteral
lib/index.js:84:29
-       destination.data(extend(true, {}, namespace))
+       destination.data(extend(false, {}, namespace))
Ran all tests for this mutant.

#31. [Survived] StringLiteral
lib/index.js:109:22
-         assertUnfrozen('data', frozen)
+         assertUnfrozen("", frozen)
Ran all tests for this mutant.

#34. [Survived] ConditionalExpression
lib/index.js:120:9
-       if (frozen) {
+       if (false) {
Ran all tests for this mutant.

#35. [Survived] BlockStatement
lib/index.js:120:17
-       if (frozen) {
-         return processor
-       }
+       if (frozen) {}
Ran all tests for this mutant.

#46. [Survived] ConditionalExpression
lib/index.js:131:11
-         if (options[0] === true) {
+         if (true) {
Ran all tests for this mutant.

#47. [Survived] ConditionalExpression
lib/index.js:131:11
-         if (options[0] === true) {
+         if (false) {
Ran all tests for this mutant.

#48. [Survived] EqualityOperator
lib/index.js:131:11
-         if (options[0] === true) {
+         if (options[0] !== true) {
Ran all tests for this mutant.

#49. [Survived] BooleanLiteral
lib/index.js:131:26
-         if (options[0] === true) {
+         if (options[0] === false) {
Ran all tests for this mutant.

#50. [Survived] BlockStatement
lib/index.js:131:32
-         if (options[0] === true) {
-           options[1] = undefined
-         }
+         if (options[0] === true) {}
Ran all tests for this mutant.

#85. [Survived] ConditionalExpression
lib/index.js:174:9
-       if (settings) {
+       if (true) {
Ran all tests for this mutant.

#110. [Survived] ConditionalExpression
lib/index.js:206:11
-         if (result.settings) {
+         if (true) {
Ran all tests for this mutant.

#113. [Survived] ConditionalExpression
lib/index.js:207:34
-           settings = Object.assign(settings || {}, result.settings)
+           settings = Object.assign(true, result.settings)
Ran all tests for this mutant.

#114. [Survived] ConditionalExpression
lib/index.js:207:34
-           settings = Object.assign(settings || {}, result.settings)
+           settings = Object.assign(false, result.settings)
Ran all tests for this mutant.

#122. [Survived] ConditionalExpression
lib/index.js:218:11
-         if (plugins === null || plugins === undefined) {
+         if (false || plugins === undefined) {
Ran all tests for this mutant.

#156. [Survived] BooleanLiteral
lib/index.js:249:26
-             value = extend(true, entry[1], value)
+             value = extend(false, entry[1], value)
Ran all tests for this mutant.

#213. [Survived] LogicalOperator
lib/index.js:394:13
-           if (error || !tree || !file) {
+           if ((error || !tree) && !file) {
Ran all tests for this mutant.

#215. [Survived] ConditionalExpression
lib/index.js:394:13
-           if (error || !tree || !file) {
+           if (false || !file) {
Ran all tests for this mutant.

#216. [Survived] LogicalOperator
lib/index.js:394:13
-           if (error || !tree || !file) {
+           if (error && !tree || !file) {
Ran all tests for this mutant.

#223. [Survived] LogicalOperator
lib/index.js:400:15
-             if (result === undefined || result === null) {
+             if (result === undefined && result === null) {
Ran all tests for this mutant.

#222. [Survived] ConditionalExpression
lib/index.js:400:15
-             if (result === undefined || result === null) {
+             if (false) {
Ran all tests for this mutant.

#225. [Survived] ConditionalExpression
lib/index.js:400:15
-             if (result === undefined || result === null) {
+             if (false || result === null) {
Ran all tests for this mutant.

#228. [Survived] ConditionalExpression
lib/index.js:400:39
-             if (result === undefined || result === null) {
+             if (result === undefined || false) {
Ran all tests for this mutant.

#237. [Survived] LogicalOperator
lib/index.js:418:13
-           if (error || !file) {
+           if (error && !file) {
Ran all tests for this mutant.

#247. [Survived] StringLiteral
lib/index.js:443:16
-       assertDone('processSync', 'process', complete)
+       assertDone("", 'process', complete)
Ran all tests for this mutant.

#248. [Survived] StringLiteral
lib/index.js:443:31
-       assertDone('processSync', 'process', complete)
+       assertDone('processSync', "", complete)
Ran all tests for this mutant.

#258. [Survived] ConditionalExpression
lib/index.js:467:5
-       typeof value === 'function' &&
+       true &&
Ran all tests for this mutant.

#266. [Survived] BlockStatement
lib/index.js:489:22
-     for (key in value) {
-       if (own.call(value, key)) {
-         return true
-       }
-     }
+     for (key in value) {}
Ran all tests for this mutant.

#265. [Survived] BlockStatement
lib/index.js:485:22
-   function keys(value) {
-     /** @type {string} */
-     let key
-     for (key in value) {
-       if (own.call(value, key)) {
-         return true
-       }
-     }
-     return false
-   }
+   function keys(value) {}
Ran all tests for this mutant.

#267. [Survived] ConditionalExpression
lib/index.js:490:9
-       if (own.call(value, key)) {
+       if (true) {
Ran all tests for this mutant.

#268. [Survived] ConditionalExpression
lib/index.js:490:9
-       if (own.call(value, key)) {
+       if (false) {
Ran all tests for this mutant.

#269. [Survived] BlockStatement
lib/index.js:490:31
-       if (own.call(value, key)) {
-         return true
-       }
+       if (own.call(value, key)) {}
Ran all tests for this mutant.

#270. [Survived] BooleanLiteral
lib/index.js:491:14
-         return true
+         return false
Ran all tests for this mutant.

#300. [Survived] ConditionalExpression
lib/index.js:550:28
-     if (!isPlainObj(node) || typeof node.type !== 'string') {
+     if (!isPlainObj(node) || false) {
Ran all tests for this mutant.

Ran 1.00 tests per mutant on average.
----------|---------|----------|-----------|------------|----------|---------|
File      | % score | # killed | # timeout | # survived | # no cov | # error |
----------|---------|----------|-----------|------------|----------|---------|
All files |   90.27 |      306 |         0 |         33 |        0 |       0 |
 index.js |   90.27 |      306 |         0 |         33 |        0 |       0 |
----------|---------|----------|-----------|------------|----------|---------|
07:44:19 (344898) ERROR MutationTestReportHelper Final mutation score 90.27 under breaking threshold 100, setting exit code to 1 (failure).

@github-actions

This comment has been minimized.

@wooorm wooorm added 👎 phase/no Post cannot or will not be acted on 🙅 no/wontfix This is not (enough of) an issue for this project and removed 🛠 blocked/wip This cannot progress yet, it’s being worked on 🤞 phase/open Post is being triaged manually labels Jan 5, 2022
@github-actions

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕸️ area/tests This affects tests 🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on
Development

Successfully merging this pull request may close these issues.

2 participants