diff --git a/scripts/stryker-diff.mjs b/scripts/stryker-diff.mjs index dd64f4e774..06d06fb7ac 100644 --- a/scripts/stryker-diff.mjs +++ b/scripts/stryker-diff.mjs @@ -57,8 +57,14 @@ export const PACKAGE_CONFIGS = [ root: "src", sourceRoot: "src/", vitestConfig: "vitest.config.ts", - vitestRelated: false, - discoverRelatedTests: true, + // Use plugin-side related-test discovery for the extension package: with an + // explicit STRYKER_TEST_FILES list, stryker-js 10.0.0 plans static mutants with + // runtime activation (stryker-mutator/stryker-js#6144, #6209), which the vitest + // plugin can only apply after top-level code has run, producing false Survived + // results. Revert to vitestRelated: false / discoverRelatedTests: true once the + // upstream planner fix lands. + vitestRelated: true, + discoverRelatedTests: false, // CI build/coverage tooling under src/scripts is excluded like the other build scripts: // it is not shipped runtime code and is covered by src/scripts/__tests__/merge-lcov.spec.mjs. excludedPaths: [ diff --git a/scripts/stryker-diff.test.mjs b/scripts/stryker-diff.test.mjs index 22284e598d..5286aba38e 100644 --- a/scripts/stryker-diff.test.mjs +++ b/scripts/stryker-diff.test.mjs @@ -254,8 +254,11 @@ describe("buildManifest", () => { assert.equal(webview.runRoot, ".") assert.equal(webview.discoverRelatedTests, true) assert.equal(webview.vitestRelated, false) - assert.equal(extension.discoverRelatedTests, true) - assert.equal(extension.vitestRelated, false) + // The extension package deliberately uses plugin-side discovery (see the + // comment in PACKAGE_CONFIGS): stryker-js 10.0.0 mis-activates static mutants + // when an explicit STRYKER_TEST_FILES list is supplied. + assert.equal(extension.discoverRelatedTests, false) + assert.equal(extension.vitestRelated, true) const types = manifest.packages.find(({ id }) => id === "types") assert.equal(types.discoverRelatedTests, undefined) assert.equal(types.vitestRelated, undefined)