testing-conventions 0.0.102 → 0.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/index.js +3 -5
- package/dist/bin/index.js.map +1 -1
- package/dist/mutation/main.js +3 -4
- package/dist/mutation/main.js.map +1 -1
- package/dist/mutation/run-stryker.js +5 -12
- package/dist/mutation/run-stryker.js.map +1 -1
- package/dist/vitest-config.d.ts +2 -0
- package/dist/vitest-config.js +2 -12
- package/dist/vitest-config.js.map +1 -1
- package/package.json +6 -6
package/dist/bin/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { main } from 'bin-shim';
|
|
4
|
-
// The
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// an explicit `--ts-mutation-adapter` CLI argument, appended only to a `unit mutation` invocation
|
|
8
|
-
// (the only command that reads it). The binary errors clearly if the arm runs without it.
|
|
4
|
+
// The rust binary cannot locate the bundled mutation adapter in the npm tree, so the launcher —
|
|
5
|
+
// which knows its own `dist/` — passes the path as `--ts-mutation-adapter` on the one command
|
|
6
|
+
// that reads it. The binary errors if the arm runs without it.
|
|
9
7
|
const args = process.argv.slice(2);
|
|
10
8
|
const isUnitMutation = args[0] === 'unit' && args[1] === 'mutation';
|
|
11
9
|
const adapter = fileURLToPath(new URL('../mutation/main.js', import.meta.url));
|
package/dist/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EA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@ -1,8 +1,7 @@
|
|
|
1
1
|
import { mutationCLI } from './mutation-cli.js';
|
|
2
|
-
// The executable the rust binary spawns for the TS mutation arm
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// no process side effects (and each stays fully covered).
|
|
2
|
+
// The executable the rust binary spawns for the TS mutation arm: it runs `mutationCLI` over the
|
|
3
|
+
// process arguments and maps a failed run onto a non-zero exit code. Separate from
|
|
4
|
+
// `mutation-cli.ts`, which stays a pure importable function with no process side effects.
|
|
6
5
|
mutationCLI(process.argv.slice(2)).catch((err) => {
|
|
7
6
|
process.stderr.write(`${err.message}\n`);
|
|
8
7
|
process.exitCode = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/mutation/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,gGAAgG;AAChG,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/mutation/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,gGAAgG;AAChG,mFAAmF;AACnF,0FAA0F;AAC1F,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;IACtD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC;IACzC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { Stryker } from '@stryker-mutator/core';
|
|
3
3
|
import { toNormalized } from './to-normalized.js';
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// over a consumer project, our bundled `@stryker-mutator/vitest-runner` isn't on that search
|
|
7
|
-
// path. Passing its resolved path as an explicit plugin makes Stryker load our copy regardless
|
|
8
|
-
// of the project's location (#246). `vitest` itself stays the consumer's (the runner's peer).
|
|
4
|
+
// Stryker discovers plugins relative to the *project* under test, so a consumer project never
|
|
5
|
+
// finds our bundled `@stryker-mutator/vitest-runner`; passing the resolved path loads our copy.
|
|
9
6
|
const vitestRunnerPlugin = createRequire(import.meta.url).resolve('@stryker-mutator/vitest-runner');
|
|
10
7
|
/**
|
|
11
8
|
* Run Stryker over the project in the current working directory via its Node API (#239) and
|
|
@@ -19,14 +16,10 @@ export async function runStryker(options = {}) {
|
|
|
19
16
|
const cliOptions = {
|
|
20
17
|
testRunner: 'vitest',
|
|
21
18
|
plugins: [vitestRunnerPlugin],
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
// preprocessor rewrites sandbox copies by importing `typescript` from
|
|
26
|
-
// @stryker-mutator/core's location — absent from this package's isolated production
|
|
27
|
-
// install — and stays out of an in-place run entirely.
|
|
19
|
+
// In place, so the run resolves through the project's own node_modules; a sandbox copy
|
|
20
|
+
// would invoke Stryker's ts-config preprocessor, which needs a `typescript` this package's
|
|
21
|
+
// production install does not carry.
|
|
28
22
|
inPlace: true,
|
|
29
|
-
// Results come from runMutationTest()'s return value, so no file/stdout reporter is needed.
|
|
30
23
|
reporters: [],
|
|
31
24
|
...(options.mutate ? { mutate: options.mutate } : {}),
|
|
32
25
|
...(options.vitestDir === undefined ? {} : { vitest: { dir: options.vitestDir } }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-stryker.js","sourceRoot":"","sources":["../../src/mutation/run-stryker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAyB,MAAM,oBAAoB,CAAC;AAiBzE,8FAA8F;AAC9F,
|
|
1
|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AAK,IAAI,CAAC,CAAC;AACrE,CAAC"}
|
package/dist/vitest-config.d.ts
CHANGED
package/dist/vitest-config.js
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { defineConfig } from 'vitest/config';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
// import { defineConfig, mergeConfig } from 'vitest/config';
|
|
6
|
-
// import { vitestConfig } from 'testing-conventions';
|
|
7
|
-
// export default mergeConfig(vitestConfig, defineConfig({ /* overrides */ }));
|
|
8
|
-
//
|
|
9
|
-
// It carries the same TypeScript coverage default the CLI enforces
|
|
10
|
-
// (100/100/100/100, branch on, v8 over `src`, declaration files excluded), so a
|
|
11
|
-
// local `vitest --coverage` run surfaces a shortfall before CI does. The numbers
|
|
12
|
-
// here are the one recommendation expressed on a second surface — keep them in
|
|
13
|
-
// step with the tool's TypeScript coverage default.
|
|
2
|
+
/** The shared vitest base config: the TypeScript coverage default the CLI enforces, for a
|
|
3
|
+
* consumer to extend with `mergeConfig`. Keep the numbers in step with that default. */
|
|
14
4
|
export const vitestConfig = defineConfig({
|
|
15
5
|
test: {
|
|
16
6
|
include: ['src/**/*.test.ts'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest-config.js","sourceRoot":"","sources":["../src/vitest-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"vitest-config.js","sourceRoot":"","sources":["../src/vitest-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;wFACwF;AACxF,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC;IACvC,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,kBAAkB,CAAC;QAC7B,QAAQ,EAAE;YACR,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAC,aAAa,CAAC;YACxB,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;SAC3E;KACF;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testing-conventions",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.104",
|
|
4
4
|
"description": "Enforce testing conventions in libraries (Python, TypeScript, and Rust).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/thekevinscott/testing-conventions",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"vitest": "^3.2.4"
|
|
56
56
|
},
|
|
57
57
|
"optionalDependencies": {
|
|
58
|
-
"@testing-conventions/x86_64-unknown-linux-gnu": "0.0.
|
|
59
|
-
"@testing-conventions/aarch64-unknown-linux-gnu": "0.0.
|
|
60
|
-
"@testing-conventions/x86_64-apple-darwin": "0.0.
|
|
61
|
-
"@testing-conventions/aarch64-apple-darwin": "0.0.
|
|
62
|
-
"@testing-conventions/x86_64-pc-windows-msvc": "0.0.
|
|
58
|
+
"@testing-conventions/x86_64-unknown-linux-gnu": "0.0.104",
|
|
59
|
+
"@testing-conventions/aarch64-unknown-linux-gnu": "0.0.104",
|
|
60
|
+
"@testing-conventions/x86_64-apple-darwin": "0.0.104",
|
|
61
|
+
"@testing-conventions/aarch64-apple-darwin": "0.0.104",
|
|
62
|
+
"@testing-conventions/x86_64-pc-windows-msvc": "0.0.104"
|
|
63
63
|
}
|
|
64
64
|
}
|