From eb3f4eb912faeb02ca8e77658733f599c50ebc0b Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Wed, 11 Oct 2023 00:14:00 +0200 Subject: [PATCH 1/2] Mutation test `testing.js` module (#1204) Configure Stryker to mutation test the `testing.js` module. This is done at the integration level because, like `index.js` it's an exposed module. In order to support this, the unit tests for injection strings were lifted to integration tests in order to provide adequate integration test coverage to guarantee 100% mutation coverage. --- stryker.integration.config.js | 2 +- test/integration/testing/commonjs.test.js | 2 +- test/integration/testing/functional.test.js | 15 +++++++++++++-- test/unit/testing/injection-strings.test.js | 14 -------------- 4 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 test/unit/testing/injection-strings.test.js diff --git a/stryker.integration.config.js b/stryker.integration.config.js index f7a8e0834..8e4714b47 100644 --- a/stryker.integration.config.js +++ b/stryker.integration.config.js @@ -3,7 +3,7 @@ export default { coverageAnalysis: "perTest", inPlace: false, - mutate: ["index.js"], + mutate: ["index.js", "testing.js"], testRunner: "tap", tap: { testFiles: ["test/integration/**/*.test.js"], diff --git a/test/integration/testing/commonjs.test.js b/test/integration/testing/commonjs.test.js index ae659e1b7..5e09d5ba3 100644 --- a/test/integration/testing/commonjs.test.js +++ b/test/integration/testing/commonjs.test.js @@ -1,6 +1,6 @@ /** * @overview Contains integration tests for the CommonJS version of the testing - * implementation of Shescape. + * utilities provided with Shescape. * @license MIT */ diff --git a/test/integration/testing/functional.test.js b/test/integration/testing/functional.test.js index 45c79cf80..b3cd09fce 100644 --- a/test/integration/testing/functional.test.js +++ b/test/integration/testing/functional.test.js @@ -1,16 +1,27 @@ /** - * @overview Contains integration tests for the testing implementation of + * @overview Contains integration tests for the testing utilities provided with * Shescape. * @license MIT */ import { testProp } from "@fast-check/ava"; +import test from "ava"; import * as fc from "fast-check"; import { arbitrary } from "../_.js"; import { Shescape } from "shescape"; -import { Shescape as Stubscape } from "shescape/testing"; +import { injectionStrings, Shescape as Stubscape } from "shescape/testing"; + +test("injection strings", (t) => { + t.true(Array.isArray(injectionStrings)); + t.true(injectionStrings.length > 0); + + for (const injectionString of injectionStrings) { + t.is(typeof injectionString, "string"); + t.true(injectionString.length > 0); + } +}); testProp( "escape (stubscape ~ shescape)", diff --git a/test/unit/testing/injection-strings.test.js b/test/unit/testing/injection-strings.test.js deleted file mode 100644 index 85d1b926b..000000000 --- a/test/unit/testing/injection-strings.test.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @overview Contains unit tests for the injection strings test helper. - * @license MIT - */ - -import test from "ava"; - -import { injectionStrings } from "../../../testing.js"; - -test("types", (t) => { - for (const injectionString of injectionStrings) { - t.is(typeof injectionString, "string"); - } -}); From 3e99c28ee2357ef773717a899c924674101e3ca0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 08:04:10 +0200 Subject: [PATCH 2/2] Bump asdf-vm/actions from 2.2.0 to 3.0.0 (#1227) Bumps [asdf-vm/actions](https://github.com/asdf-vm/actions) from 2.2.0 to 3.0.0. - [Release notes](https://github.com/asdf-vm/actions/releases) - [Changelog](https://github.com/asdf-vm/actions/blob/master/CHANGELOG.md) - [Commits](https://github.com/asdf-vm/actions/compare/6a442392015fbbdd8b48696d41e0051b2698b2e4...4f8f7939dd917fc656bb7c3575969a5988c28364) --- updated-dependencies: - dependency-name: asdf-vm/actions dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a583bf53c..d0a241137 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -161,7 +161,7 @@ jobs: - name: Checkout repository uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Install tooling - uses: asdf-vm/actions/install@6a442392015fbbdd8b48696d41e0051b2698b2e4 # v2.2.0 + uses: asdf-vm/actions/install@4f8f7939dd917fc656bb7c3575969a5988c28364 # v3.0.0 - name: Install Node.js uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 with: