jest-runner-cli 0.2.2 → 0.2.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOnD,QAAA,MAAM,aAAa,KAA4B,CAAC;AAEhD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAanD,QAAA,MAAM,aAAa,KAA4B,CAAC;AAEhD,eAAe,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,15 @@
1
- import { createRequire } from 'module';
1
+ import { fileURLToPath } from 'url';
2
+ import { dirname, join } from 'path';
2
3
  import { CliRunner } from './CliRunner.js';
3
4
  export { CliRunner };
4
- const require = createRequire(import.meta.url);
5
- const { createJestRunner } = require('create-jest-runner');
6
- const runPath = new URL('./run.js', import.meta.url).pathname;
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+ // Dynamically import create-jest-runner to handle ESM/CommonJS interop
8
+ const createJestRunnerModule = await import('create-jest-runner');
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ const createJestRunner = createJestRunnerModule.createJestRunner;
11
+ // Use absolute file path to the run.js module
12
+ const runPath = join(__dirname, 'run.js');
7
13
  const JestRunnerCli = createJestRunner(runPath);
8
14
  export default JestRunnerCli;
9
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,CAAC;AAGrB,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE3D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;AAE9D,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAEhD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,CAAC;AAGrB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,uEAAuE;AACvE,MAAM,sBAAsB,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAClE,8DAA8D;AAC9D,MAAM,gBAAgB,GAAI,sBAA8B,CAAC,gBAAgB,CAAC;AAE1E,8CAA8C;AAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAE1C,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAEhD,eAAe,aAAa,CAAC"}
package/dist/run.d.ts CHANGED
@@ -2,13 +2,14 @@ import type { Config } from '@jest/types';
2
2
  import type { JestEnvironment } from '@jest/environment';
3
3
  import type Runtime from 'jest-runtime';
4
4
  /**
5
- * Jest runner entry point that delegates to the core runTest helper.
5
+ * Jest runner entry point that runs a test file.
6
+ * This delegates to the Jest internal runTest implementation.
6
7
  * @param {Config.GlobalConfig} globalConfig - Jest global configuration.
7
8
  * @param {Config.ProjectConfig} projectConfig - Project-specific configuration.
8
9
  * @param {JestEnvironment} environment - Jest test environment instance.
9
10
  * @param {Runtime} runtime - Jest runtime used to execute the test.
10
11
  * @param {string} testPath - Path to the test file.
11
- * @returns {Promise<unknown>} Execution result from runTest.
12
+ * @returns {Promise<unknown>} Execution result from Jest runner.
12
13
  */
13
14
  export default function run(globalConfig: Config.GlobalConfig, projectConfig: Config.ProjectConfig, environment: JestEnvironment, runtime: Runtime, testPath: string): Promise<unknown>;
14
15
  //# sourceMappingURL=run.d.ts.map
package/dist/run.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAKxC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,GAAG,CACzB,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,oBAGjB"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC;;;;;;;;;GASG;AACH,wBAA8B,GAAG,CAC/B,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAiBlB"}
package/dist/run.js CHANGED
@@ -1,15 +1,31 @@
1
- // jest-runner �� runTest �֐��𒼐ڎ擾
2
- import runTest from 'jest-runner/build/runTest.js';
3
1
  /**
4
- * Jest runner entry point that delegates to the core runTest helper.
2
+ * Jest runner entry point that runs a test file.
3
+ * This delegates to the Jest internal runTest implementation.
5
4
  * @param {Config.GlobalConfig} globalConfig - Jest global configuration.
6
5
  * @param {Config.ProjectConfig} projectConfig - Project-specific configuration.
7
6
  * @param {JestEnvironment} environment - Jest test environment instance.
8
7
  * @param {Runtime} runtime - Jest runtime used to execute the test.
9
8
  * @param {string} testPath - Path to the test file.
10
- * @returns {Promise<unknown>} Execution result from runTest.
9
+ * @returns {Promise<unknown>} Execution result from Jest runner.
11
10
  */
12
- export default function run(globalConfig, projectConfig, environment, runtime, testPath) {
13
- return runTest(testPath, globalConfig, projectConfig, environment, runtime);
11
+ export default async function run(globalConfig, projectConfig, environment, runtime, testPath) {
12
+ // Dynamically load jest-runner's runTest function
13
+ // This allows for ESM/CommonJS interop and avoids bundling issues
14
+ try {
15
+ const runTestModule = await import('jest-runner/build/runTest.js');
16
+ const runTest = runTestModule.default;
17
+ return await runTest(testPath, globalConfig, projectConfig, environment, runtime);
18
+ }
19
+ catch (error) {
20
+ // If jest-runner is not available, try jest-circus (the default test runner)
21
+ try {
22
+ const runTestModule = await import('jest-circus/runner.js');
23
+ const runTest = runTestModule.default;
24
+ return await runTest(testPath, globalConfig, projectConfig, environment, runtime);
25
+ }
26
+ catch (_) {
27
+ throw error;
28
+ }
29
+ }
14
30
  }
15
31
  //# sourceMappingURL=run.js.map
package/dist/run.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAIA,kCAAkC;AAClC,OAAO,OAAO,MAAM,8BAA8B,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,GAAG,CACzB,YAAiC,EACjC,aAAmC,EACnC,WAA4B,EAC5B,OAAgB,EAChB,QAAgB;IAEhB,OAAO,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAC9E,CAAC"}
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,GAAG,CAC/B,YAAiC,EACjC,aAAmC,EACnC,WAA4B,EAC5B,OAAgB,EAChB,QAAgB;IAEhB,kDAAkD;IAClD,kEAAkE;IAClE,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC;QACnE,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;QACtC,OAAO,MAAM,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,6EAA6E;QAC7E,IAAI,CAAC;YACH,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAC5D,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;YACtC,OAAO,MAAM,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QACpF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-runner-cli",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Jest custom runner for CLI workflows with a minimal CliRunner helper",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",