diff --git a/src/__tests__/test-file-size-ratchet.test.ts b/scripts/__tests__/test-file-size-ratchet.test.ts similarity index 99% rename from src/__tests__/test-file-size-ratchet.test.ts rename to scripts/__tests__/test-file-size-ratchet.test.ts index ec134c7ab5..c2dc784c3a 100644 --- a/src/__tests__/test-file-size-ratchet.test.ts +++ b/scripts/__tests__/test-file-size-ratchet.test.ts @@ -1,8 +1,8 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { walkFiles } from '../../scripts/lib/walk-files.ts'; -import { runCmdSync } from '../utils/exec.ts'; +import { walkFiles } from '../lib/walk-files.ts'; +import { runCmdSync } from '../../src/utils/exec.ts'; /** * Test-file size ratchet (AGENTS.md "Scope & shape": past 1,000 lines is architecture debt, diff --git a/scripts/mutation/modules.test.ts b/scripts/mutation/modules.test.ts index 898c74ddc7..fd113ace37 100644 --- a/scripts/mutation/modules.test.ts +++ b/scripts/mutation/modules.test.ts @@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url'; import { affectedModules, ALL_MODULE_IDS, + isKernelTestFile, KERNEL_MODULES, moduleForFile, mutateGlobs, @@ -75,3 +76,16 @@ test('the shard matrix slices only the modules that declare shards', () => { ); } }); + +test('a kernel test is reachable only under root or package src', () => { + // Load-bearing for where `test-file-size-ratchet.test.ts` lives. It measures the + // repository's own files and git history, neither of which Stryker's sandbox copy can + // answer, so it sits in `scripts/__tests__/` (explicitly included by `unit-core`) and + // this predicate is what keeps it out of every mutation lane. Widening the pattern to + // scripts/ would silently pull it back in and fail every dry run. + assert.ok(isKernelTestFile('src/daemon/__tests__/ref-frame.test.ts')); + assert.ok(isKernelTestFile('packages/selectors/src/parse.test.ts')); + assert.ok(!isKernelTestFile('scripts/__tests__/test-file-size-ratchet.test.ts')); + assert.ok(!isKernelTestFile('test/integration/daemon.test.ts')); + assert.ok(!isKernelTestFile('src/daemon/ref-frame.ts')); +}); diff --git a/test/integration/provider-scenarios/android-settings-contract.ts b/test/integration/provider-scenarios/android-settings-contract.ts index c0f4b20048..ad7d0abc68 100644 --- a/test/integration/provider-scenarios/android-settings-contract.ts +++ b/test/integration/provider-scenarios/android-settings-contract.ts @@ -7,7 +7,7 @@ type AndroidSettingsWorld = Awaited