testing-conventions 0.0.107 → 0.0.109

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.
@@ -5,8 +5,7 @@
5
5
  * Stryker through the Node API and emits the normalized results as JSON. `--out <path>` writes
6
6
  * them to a file (the rule passes a temp file, so Stryker's own stdout logging can't corrupt
7
7
  * them); without it, the JSON goes to stdout. `--mutate <a,b,...>` scopes the run to those Stryker
8
- * mutate patterns, and `--vitest-dir <path>` scopes vitest's test discovery to that directory
9
- * (the scan path within the package). Rejects on a failed run; `main.ts` maps that onto a
10
- * non-zero exit code.
8
+ * mutate patterns, and `--test-files <a,b,...>` narrows the suites that judge them to the scan
9
+ * path within the package. Rejects on a failed run; `main.ts` maps that onto a non-zero exit code.
11
10
  */
12
11
  export declare function mutationCLI(argv: string[]): Promise<void>;
@@ -8,15 +8,14 @@ import { runStryker } from './run-stryker.js';
8
8
  * Stryker through the Node API and emits the normalized results as JSON. `--out <path>` writes
9
9
  * them to a file (the rule passes a temp file, so Stryker's own stdout logging can't corrupt
10
10
  * them); without it, the JSON goes to stdout. `--mutate <a,b,...>` scopes the run to those Stryker
11
- * mutate patterns, and `--vitest-dir <path>` scopes vitest's test discovery to that directory
12
- * (the scan path within the package). Rejects on a failed run; `main.ts` maps that onto a
13
- * non-zero exit code.
11
+ * mutate patterns, and `--test-files <a,b,...>` narrows the suites that judge them to the scan
12
+ * path within the package. Rejects on a failed run; `main.ts` maps that onto a non-zero exit code.
14
13
  */
15
14
  export async function mutationCLI(argv) {
16
- const { mutate, out, vitestDir } = parseArgs(argv);
15
+ const { mutate, out, testFiles } = parseArgs(argv);
17
16
  const results = await runStryker({
18
17
  ...(mutate === undefined ? {} : { mutate }),
19
- ...(vitestDir === undefined ? {} : { vitestDir }),
18
+ ...(testFiles === undefined ? {} : { testFiles }),
20
19
  });
21
20
  const json = `${JSON.stringify(results)}\n`;
22
21
  if (out === undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"mutation-cli.js","sourceRoot":"","sources":["../../src/mutation/mutation-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAc;IAC9C,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC;QAC/B,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;KAClD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;IAC5C,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,MAAM,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"mutation-cli.js","sourceRoot":"","sources":["../../src/mutation/mutation-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAc;IAC9C,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC;QAC/B,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;KAClD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;IAC5C,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,MAAM,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
@@ -4,15 +4,15 @@ export interface AdapterArgs {
4
4
  mutate?: string[];
5
5
  /** File to write the normalized-results JSON to (`--out <path>`); stdout when absent. */
6
6
  out?: string;
7
- /** Directory vitest discovers tests in (`--vitest-dir <path>`), relative to the project root. */
8
- vitestDir?: string;
7
+ /** Stryker `testFiles` patterns (`--test-files a,b,...`), relative to the project root. */
8
+ testFiles?: string[];
9
9
  }
10
10
  /**
11
11
  * Parse the adapter's CLI arguments with Node's built-in `util.parseArgs`: `--out <path>` (where
12
12
  * to write the normalized JSON — the rule passes a temp file so Stryker's own stdout logging can't
13
13
  * corrupt the results), `--mutate <a,b,...>` (Stryker mutate patterns, comma-split into a list),
14
- * and `--vitest-dir <path>` (the directory vitest discovers tests in — the scan path within the
15
- * package, so the colocated unit suite alone judges the mutants). All are optional; the rust
14
+ * and `--test-files <a,b,...>` (Stryker `testFiles` patterns, comma-split — the scan path within
15
+ * the package, so its colocated suite alone judges the mutants). All are optional; the rust
16
16
  * binary supplies the argv, so it stays a fixed, controlled shape.
17
17
  */
18
18
  export declare function parseArgs(argv: string[]): AdapterArgs;
@@ -3,8 +3,8 @@ import { parseArgs as parseNodeArgs } from 'node:util';
3
3
  * Parse the adapter's CLI arguments with Node's built-in `util.parseArgs`: `--out <path>` (where
4
4
  * to write the normalized JSON — the rule passes a temp file so Stryker's own stdout logging can't
5
5
  * corrupt the results), `--mutate <a,b,...>` (Stryker mutate patterns, comma-split into a list),
6
- * and `--vitest-dir <path>` (the directory vitest discovers tests in — the scan path within the
7
- * package, so the colocated unit suite alone judges the mutants). All are optional; the rust
6
+ * and `--test-files <a,b,...>` (Stryker `testFiles` patterns, comma-split — the scan path within
7
+ * the package, so its colocated suite alone judges the mutants). All are optional; the rust
8
8
  * binary supplies the argv, so it stays a fixed, controlled shape.
9
9
  */
10
10
  export function parseArgs(argv) {
@@ -13,7 +13,7 @@ export function parseArgs(argv) {
13
13
  options: {
14
14
  mutate: { type: 'string' },
15
15
  out: { type: 'string' },
16
- 'vitest-dir': { type: 'string' },
16
+ 'test-files': { type: 'string' },
17
17
  },
18
18
  allowPositionals: true,
19
19
  });
@@ -24,8 +24,8 @@ export function parseArgs(argv) {
24
24
  if (values.out !== undefined) {
25
25
  result.out = values.out;
26
26
  }
27
- if (values['vitest-dir'] !== undefined) {
28
- result.vitestDir = values['vitest-dir'];
27
+ if (values['test-files'] !== undefined) {
28
+ result.testFiles = values['test-files'].split(',');
29
29
  }
30
30
  return result;
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parse-args.js","sourceRoot":"","sources":["../../src/mutation/parse-args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AAYvD;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;QAC/B,IAAI,EAAE,IAAI;QACV,OAAO,EAAE;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AAS,EAAE,CAAC;QAChC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IAC1B,CAAC;IACD,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -7,11 +7,10 @@ export interface RunStrykerOptions {
7
7
  */
8
8
  mutate?: string[];
9
9
  /**
10
- * Directory vitest discovers tests in (the vitest runner's `vitest.dir`), relative to the
11
- * project root the scan path within the package, so the colocated unit suite alone judges
12
- * the mutants. Omitted ⇒ vitest's configured/default discovery over the whole project.
10
+ * Stryker `testFiles` patterns, relative to the project root: the suites that judge the
11
+ * mutants. Omitted the runner's own discovery.
13
12
  */
14
- vitestDir?: string;
13
+ testFiles?: string[];
15
14
  }
16
15
  /**
17
16
  * Run Stryker over the project in the current working directory via its Node API (#239) and
@@ -22,7 +22,7 @@ export async function runStryker(options = {}) {
22
22
  inPlace: true,
23
23
  reporters: [],
24
24
  ...(options.mutate ? { mutate: options.mutate } : {}),
25
- ...(options.vitestDir === undefined ? {} : { vitest: { dir: options.vitestDir } }),
25
+ ...(options.testFiles === undefined ? {} : { testFiles: options.testFiles }),
26
26
  };
27
27
  const results = await new Stryker(cliOptions).runMutationTest();
28
28
  const projectRoot = process.cwd();
@@ -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,MA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": "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.107",
59
- "@testing-conventions/aarch64-unknown-linux-gnu": "0.0.107",
60
- "@testing-conventions/x86_64-apple-darwin": "0.0.107",
61
- "@testing-conventions/aarch64-apple-darwin": "0.0.107",
62
- "@testing-conventions/x86_64-pc-windows-msvc": "0.0.107"
58
+ "@testing-conventions/x86_64-unknown-linux-gnu": "0.0.109",
59
+ "@testing-conventions/aarch64-unknown-linux-gnu": "0.0.109",
60
+ "@testing-conventions/x86_64-apple-darwin": "0.0.109",
61
+ "@testing-conventions/aarch64-apple-darwin": "0.0.109",
62
+ "@testing-conventions/x86_64-pc-windows-msvc": "0.0.109"
63
63
  }
64
64
  }