ava 7.0.0 → 8.0.0

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.
Files changed (61) hide show
  1. package/entrypoints/{eslint-plugin-helper.cjs → eslint-plugin-helper.js} +10 -13
  2. package/entrypoints/{internal.d.mts → internal.d.ts} +1 -1
  3. package/entrypoints/{main.d.mts → main.d.ts} +5 -5
  4. package/entrypoints/{main.mjs → main.js} +1 -1
  5. package/entrypoints/{plugin.d.cts → plugin.d.ts} +2 -2
  6. package/entrypoints/plugin.js +1 -0
  7. package/index.d.ts +2 -2
  8. package/lib/api-event-iterator.js +2 -2
  9. package/lib/api.js +6 -6
  10. package/lib/assert.js +6 -5
  11. package/lib/cli.js +7 -27
  12. package/lib/create-chain.js +68 -25
  13. package/lib/extensions.js +5 -7
  14. package/lib/fork.js +3 -3
  15. package/lib/{glob-helpers.cjs → glob-helpers.js} +16 -30
  16. package/lib/globs.js +3 -3
  17. package/lib/{ipc-flow-control.cjs → ipc-flow-control.js} +1 -4
  18. package/lib/load-config.js +2 -3
  19. package/lib/{now-and-timers.cjs → now-and-timers.js} +11 -8
  20. package/lib/pkg.js +1 -0
  21. package/lib/plugin-support/shared-worker-loader.js +2 -2
  22. package/lib/plugin-support/shared-workers.js +3 -3
  23. package/lib/provider-manager.js +6 -5
  24. package/lib/reporters/default.js +1 -1
  25. package/lib/reporters/improper-usage-messages.js +1 -1
  26. package/lib/reporters/tap.js +10 -4
  27. package/lib/runner.js +5 -5
  28. package/lib/scheduler.js +1 -1
  29. package/lib/snapshot-manager.js +2 -2
  30. package/lib/test.js +15 -8
  31. package/lib/watcher.js +10 -18
  32. package/lib/worker/base.js +17 -41
  33. package/lib/worker/{channel.cjs → channel.js} +21 -25
  34. package/lib/worker/completion-handlers.js +3 -3
  35. package/lib/worker/{guard-environment.cjs → guard-environment.js} +4 -5
  36. package/lib/worker/line-numbers.js +3 -7
  37. package/lib/worker/main.js +11 -0
  38. package/lib/worker/{options.cjs → options.js} +4 -5
  39. package/lib/worker/{plugin.cjs → plugin.js} +8 -10
  40. package/lib/worker/state.js +5 -0
  41. package/lib/worker/utils.js +5 -0
  42. package/package.json +28 -36
  43. package/plugin.d.ts +1 -1
  44. package/types/{test-fn.d.cts → test-fn.d.ts} +24 -3
  45. package/types/{try-fn.d.cts → try-fn.d.ts} +1 -2
  46. package/entrypoints/main.cjs +0 -2
  47. package/entrypoints/main.d.cts +0 -12
  48. package/entrypoints/plugin.cjs +0 -2
  49. package/entrypoints/plugin.d.mts +0 -6
  50. package/entrypoints/plugin.mjs +0 -4
  51. package/lib/module-types.js +0 -85
  52. package/lib/pkg.cjs +0 -2
  53. package/lib/slash.cjs +0 -36
  54. package/lib/worker/main.cjs +0 -12
  55. package/lib/worker/state.cjs +0 -6
  56. package/lib/worker/utils.cjs +0 -6
  57. /package/entrypoints/{cli.mjs → cli.js} +0 -0
  58. /package/types/{assertions.d.cts → assertions.d.ts} +0 -0
  59. /package/types/{shared-worker.d.cts → shared-worker.d.ts} +0 -0
  60. /package/types/{state-change-events.d.cts → state-change-events.d.ts} +0 -0
  61. /package/types/{subscribable.d.cts → subscribable.d.ts} +0 -0
@@ -1,16 +1,12 @@
1
1
  import * as fs from 'node:fs';
2
- import {createRequire, findSourceMap} from 'node:module';
2
+ import {findSourceMap} from 'node:module';
3
3
  import {pathToFileURL} from 'node:url';
4
4
 
5
+ import * as acorn from 'acorn';
6
+ import * as walk from 'acorn-walk';
5
7
  import callsites from 'callsites';
6
8
 
7
- const require = createRequire(import.meta.url);
8
-
9
9
  function parse(file) {
10
- // Avoid loading these until we actually need to select tests by line number.
11
- const acorn = require('acorn');
12
- const walk = require('acorn-walk');
13
-
14
10
  const ast = acorn.parse(fs.readFileSync(file, 'utf8'), {
15
11
  ecmaVersion: 'latest',
16
12
  locations: true,
@@ -0,0 +1,11 @@
1
+ import './guard-environment.js'; // eslint-disable-line import-x/no-unassigned-import
2
+
3
+ import assert from 'node:assert';
4
+
5
+ import {flags, refs} from './state.js';
6
+
7
+ assert.ok(refs.runnerChain);
8
+
9
+ flags.loadedMain = true;
10
+
11
+ export default refs.runnerChain;
@@ -1,17 +1,16 @@
1
- 'use strict';
2
1
  let options = null;
3
- exports.get = () => {
2
+ export function get() {
4
3
  if (!options) {
5
4
  throw new Error('Options have not yet been set');
6
5
  }
7
6
 
8
7
  return options;
9
- };
8
+ }
10
9
 
11
- exports.set = newOptions => {
10
+ export function set(newOptions) {
12
11
  if (options) {
13
12
  throw new Error('Options have already been set');
14
13
  }
15
14
 
16
15
  options = newOptions;
17
- };
16
+ }
@@ -1,10 +1,10 @@
1
- const pkg = require('../../package.json');
1
+ import pkg from '../pkg.js';
2
2
 
3
- const {registerSharedWorker: register} = require('./channel.cjs');
4
- const options = require('./options.cjs');
5
- const {sharedWorkerTeardowns, waitForReady} = require('./state.cjs');
3
+ import {registerSharedWorker as register} from './channel.js';
4
+ import {get as getOptions} from './options.js';
5
+ import {sharedWorkerTeardowns, waitForReady} from './state.js';
6
6
 
7
- require('./guard-environment.cjs'); // eslint-disable-line import-x/no-unassigned-import
7
+ import './guard-environment.js'; // eslint-disable-line import-x/no-unassigned-import
8
8
 
9
9
  const workers = new Map();
10
10
  const workerTeardownFns = new WeakMap();
@@ -83,13 +83,13 @@ function createSharedWorker(filename, initialData, teardown) {
83
83
  };
84
84
  }
85
85
 
86
- function registerSharedWorker({
86
+ export function registerSharedWorker({
87
87
  filename,
88
88
  initialData,
89
89
  supportedProtocols,
90
90
  teardown,
91
91
  }) {
92
- const options_ = options.get();
92
+ const options_ = getOptions();
93
93
 
94
94
  if (!options_.workerThreads) {
95
95
  throw new Error('Shared workers can be used only when worker threads are enabled');
@@ -108,7 +108,7 @@ function registerSharedWorker({
108
108
  // order. Any error will crash the worker.
109
109
  const teardownFns = workerTeardownFns.get(worker);
110
110
  if (teardownFns !== undefined) {
111
- for await (const fn of [...teardownFns].reverse()) {
111
+ for await (const fn of [...teardownFns].toReversed()) {
112
112
  await fn();
113
113
  }
114
114
  }
@@ -126,5 +126,3 @@ function registerSharedWorker({
126
126
 
127
127
  return worker;
128
128
  }
129
-
130
- exports.registerSharedWorker = registerSharedWorker;
@@ -0,0 +1,5 @@
1
+ export const flags = {loadedMain: false};
2
+ export const refs = {runnerChain: null};
3
+ export const completionHandlers = [];
4
+ export const sharedWorkerTeardowns = [];
5
+ export const waitForReady = [];
@@ -0,0 +1,5 @@
1
+ import process from 'node:process';
2
+ import {isMainThread} from 'node:worker_threads';
3
+
4
+ export const isRunningInThread = isMainThread === false;
5
+ export const isRunningInChildProcess = typeof process.send === 'function';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ava",
3
- "version": "7.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "Node.js test runner that lets you develop with confidence.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,37 +9,25 @@
9
9
  },
10
10
  "homepage": "https://avajs.dev",
11
11
  "bin": {
12
- "ava": "entrypoints/cli.mjs"
12
+ "ava": "entrypoints/cli.js"
13
13
  },
14
14
  "exports": {
15
15
  ".": {
16
- "import": {
17
- "types": "./entrypoints/main.d.mts",
18
- "default": "./entrypoints/main.mjs"
19
- },
20
- "require": {
21
- "types": "./entrypoints/main.d.cts",
22
- "default": "./entrypoints/main.cjs"
23
- }
16
+ "types": "./entrypoints/main.d.ts",
17
+ "default": "./entrypoints/main.js"
24
18
  },
25
- "./eslint-plugin-helper": "./entrypoints/eslint-plugin-helper.cjs",
19
+ "./eslint-plugin-helper": "./entrypoints/eslint-plugin-helper.js",
26
20
  "./plugin": {
27
- "import": {
28
- "types": "./entrypoints/plugin.d.mts",
29
- "default": "./entrypoints/plugin.mjs"
30
- },
31
- "require": {
32
- "types": "./entrypoints/plugin.d.cts",
33
- "default": "./entrypoints/plugin.cjs"
34
- }
21
+ "types": "./entrypoints/plugin.d.ts",
22
+ "default": "./entrypoints/plugin.js"
35
23
  },
36
24
  "./internal": {
37
- "types": "./entrypoints/internal.d.mts"
25
+ "types": "./entrypoints/internal.d.ts"
38
26
  }
39
27
  },
40
28
  "type": "module",
41
29
  "engines": {
42
- "node": "^20.19 || ^22.20 || ^24.12 || >=25"
30
+ "node": "^22.20 || ^24.12 || >=25"
43
31
  },
44
32
  "scripts": {
45
33
  "test": "./scripts/test.sh"
@@ -86,66 +74,70 @@
86
74
  "typescript"
87
75
  ],
88
76
  "dependencies": {
89
- "@vercel/nft": "^1.3.2",
77
+ "@vercel/nft": "^1.5.0",
90
78
  "acorn": "^8.16.0",
91
79
  "acorn-walk": "^8.3.5",
92
80
  "ansi-styles": "^6.2.3",
93
81
  "arrgv": "^1.0.2",
94
82
  "arrify": "^3.0.0",
95
83
  "callsites": "^4.2.0",
96
- "cbor": "^10.0.11",
84
+ "cbor": "^10.0.12",
97
85
  "chalk": "^5.6.2",
98
86
  "chunkd": "^2.0.1",
99
87
  "ci-info": "^4.4.0",
100
88
  "ci-parallel-vars": "^1.0.1",
101
- "cli-truncate": "^5.1.1",
89
+ "cli-truncate": "^6.0.0",
102
90
  "code-excerpt": "^4.0.0",
103
91
  "common-path-prefix": "^3.0.0",
104
92
  "concordance": "^5.0.4",
105
93
  "currently-unhandled": "^0.4.1",
106
94
  "debug": "^4.4.3",
107
- "emittery": "^1.2.0",
95
+ "emittery": "^2.0.0",
108
96
  "figures": "^6.1.0",
109
- "globby": "^16.1.1",
97
+ "globby": "^16.2.0",
110
98
  "ignore-by-default": "^2.1.0",
111
99
  "indent-string": "^5.0.0",
112
100
  "is-plain-object": "^5.0.0",
113
101
  "is-promise": "^4.0.0",
114
102
  "matcher": "^6.0.0",
115
- "memoize": "^10.2.0",
103
+ "memoize": "^11.0.0",
116
104
  "ms": "^2.1.3",
117
105
  "p-map": "^7.0.4",
118
106
  "package-config": "^5.0.0",
119
- "picomatch": "^4.0.3",
107
+ "picomatch": "^4.0.4",
120
108
  "plur": "^6.0.0",
121
109
  "pretty-ms": "^9.3.0",
122
110
  "resolve-cwd": "^3.0.0",
111
+ "slash": "^5.1.0",
123
112
  "stack-utils": "^2.0.6",
124
113
  "supertap": "^3.0.1",
125
114
  "temp-dir": "^3.0.0",
126
- "write-file-atomic": "^7.0.0",
115
+ "write-file-atomic": "^7.0.1",
127
116
  "yargs": "^18.0.0"
128
117
  },
129
118
  "devDependencies": {
130
119
  "@ava/test": "github:avajs/test",
131
- "@ava/typescript": "^6.0.0",
120
+ "@ava/typescript": "^7.0.0",
132
121
  "@sindresorhus/tsconfig": "^8.1.0",
133
- "@types/node": "^24.10.15",
122
+ "@types/node": "^24.12.2",
134
123
  "ansi-escapes": "^7.3.0",
135
124
  "c8": "^11.0.0",
136
125
  "execa": "^9.6.1",
137
- "expect": "^30.2.0",
138
- "sinon": "^21.0.1",
139
- "tap": "^21.6.2",
126
+ "expect": "^30.3.0",
127
+ "sinon": "^21.0.3",
128
+ "tap": "^21.6.3",
140
129
  "tempy": "^3.2.0",
141
130
  "tsd": "^0.33.0",
142
- "typescript": "~5.9.3",
143
- "xo": "^1.2.3",
131
+ "typescript": "~6.0.2",
132
+ "xo": "^2.0.2",
144
133
  "zen-observable": "^0.10.0"
145
134
  },
146
135
  "overrides": {
147
136
  "c8": {
148
137
  "yargs": "^18.0.0"
138
+ },
139
+ "test-exclude": {
140
+ "glob": ">=13"
149
141
  }
150
142
  },
151
143
  "peerDependencies": {
package/plugin.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // For compatibility with resolution algorithms other than Node16.
2
2
 
3
- export * from './entrypoints/plugin.cjs';
3
+ export * from './entrypoints/plugin.js';
@@ -1,6 +1,6 @@
1
- import type {Assertions} from './assertions.cjs';
2
- import type {Subscribable} from './subscribable.cjs';
3
- import type {TryFn} from './try-fn.cjs';
1
+ import type {Assertions} from './assertions.js';
2
+ import type {Subscribable} from './subscribable.js';
3
+ import type {TryFn} from './try-fn.js';
4
4
 
5
5
  /** The `t` value passed to test & hook implementations. */
6
6
  export type ExecutionContext<Context = unknown> = {
@@ -15,6 +15,7 @@ export type ExecutionContext<Context = unknown> = {
15
15
 
16
16
  readonly log: LogFn;
17
17
  readonly plan: PlanFn;
18
+ /** Declare a function to be run after the test has ended. */
18
19
  readonly teardown: TeardownFn;
19
20
  readonly timeout: TimeoutFn;
20
21
  readonly try: TryFn<Context>;
@@ -90,8 +91,13 @@ export type TestFn<Context = unknown> = {
90
91
  macro: MacroFn<Context>;
91
92
  meta: Meta;
92
93
  only: OnlyFn<Context>;
94
+ /** Declare a test that only runs when `condition` is true; otherwise the test is skipped. */
95
+ runIf: RunIfFn<TestFn<Context>>;
93
96
  serial: SerialFn<Context>;
94
97
  skip: SkipFn<Context>;
98
+ /** Declare a test that is skipped when `condition` is true. */
99
+ skipIf: SkipIfFn<TestFn<Context>>;
100
+ /** Declare a test that should be implemented later. */
95
101
  todo: TodoFn;
96
102
  };
97
103
 
@@ -158,7 +164,11 @@ export type FailingFn<Context = unknown> = {
158
164
  <Args extends unknown[]>(macro: Macro<Args, Context>, ...args: Args): void;
159
165
 
160
166
  only: OnlyFn<Context>;
167
+ /** Declare a test that only runs when `condition` is true; otherwise the test is skipped. */
168
+ runIf: RunIfFn<FailingFn<Context>>;
161
169
  skip: SkipFn<Context>;
170
+ /** Declare a test that is skipped when `condition` is true. */
171
+ skipIf: SkipIfFn<FailingFn<Context>>;
162
172
  };
163
173
 
164
174
  export type HookSkipFn<Context = unknown> = {
@@ -183,6 +193,9 @@ export type OnlyFn<Context = unknown> = {
183
193
  <Args extends unknown[]>(macro: Macro<Args, Context>, ...args: Args): void;
184
194
  };
185
195
 
196
+ /** Declare a test that only runs when `condition` is true; otherwise the test is skipped. */
197
+ export type RunIfFn<Chain> = (condition: boolean) => Chain;
198
+
186
199
  export type SerialFn<Context = unknown> = {
187
200
  /** Declare a serial test. Additional arguments are passed to the implementation or macro. */
188
201
  <Args extends unknown[]>(title: string, implementation: Implementation<Args, Context>, ...args: Args): void;
@@ -198,7 +211,12 @@ export type SerialFn<Context = unknown> = {
198
211
  beforeEach: BeforeFn<Context>;
199
212
  failing: FailingFn<Context>;
200
213
  only: OnlyFn<Context>;
214
+ /** Declare a test that only runs when `condition` is true; otherwise the test is skipped. */
215
+ runIf: RunIfFn<SerialFn<Context>>;
201
216
  skip: SkipFn<Context>;
217
+ /** Declare a test that is skipped when `condition` is true. */
218
+ skipIf: SkipIfFn<SerialFn<Context>>;
219
+ /** Declare a test that should be implemented later. */
202
220
  todo: TodoFn;
203
221
  };
204
222
 
@@ -210,6 +228,9 @@ export type SkipFn<Context = unknown> = {
210
228
  <Args extends unknown[]>(macro: Macro<Args, Context>, ...args: Args): void;
211
229
  };
212
230
 
231
+ /** Declare a test that is skipped when `condition` is true. */
232
+ export type SkipIfFn<Chain> = (condition: boolean) => Chain;
233
+
213
234
  /** Declare a test that should be implemented later. */
214
235
  export type TodoFn = (title: string) => void;
215
236
 
@@ -1,4 +1,4 @@
1
- import type {Implementation} from './test-fn.cjs';
1
+ import type {Implementation} from './test-fn.js';
2
2
 
3
3
  export type CommitDiscardOptions = {
4
4
  /**
@@ -55,4 +55,3 @@ export type TryFn<Context = unknown> = {
55
55
  */
56
56
  <Args extends unknown[]>(fn: Implementation<Args, Context>, ...args: Args): Promise<TryResult>;
57
57
  };
58
-
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- module.exports = require('../lib/worker/main.cjs');
@@ -1,12 +0,0 @@
1
- import type {TestFn} from '../types/test-fn.cjs';
2
-
3
- export type * from '../types/assertions.cjs';
4
- export type * from '../types/try-fn.cjs';
5
- export type * from '../types/test-fn.cjs';
6
- export type * from '../types/subscribable.cjs';
7
-
8
- /** Call to declare a test, or chain to declare hooks or test modifiers */
9
- declare const test: TestFn;
10
-
11
- /** Call to declare a test, or chain to declare hooks or test modifiers */
12
- export default test;
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- module.exports = require('../lib/worker/plugin.cjs');
@@ -1,6 +0,0 @@
1
- import type {SharedWorker} from '../types/shared-worker.cjs';
2
-
3
- export function registerSharedWorker<Data = unknown>(options: SharedWorker.Plugin.RegistrationOptions<'ava-4', Data>): SharedWorker.Plugin.Protocol<Data>;
4
- // Add overloads for additional protocols.
5
-
6
- export type {SharedWorker} from '../types/shared-worker.cjs';
@@ -1,4 +0,0 @@
1
- import * as plugin from '../lib/worker/plugin.cjs';
2
-
3
- const {registerSharedWorker} = plugin;
4
- export {registerSharedWorker};
@@ -1,85 +0,0 @@
1
- const requireTrueValue = value => {
2
- if (value !== true) {
3
- throw new TypeError('When specifying module types, use `true` for ’cjs’, ’mjs’ and ’js’ extensions');
4
- }
5
- };
6
-
7
- const normalize = (extension, type, defaultModuleType) => {
8
- switch (extension) {
9
- case 'cjs': {
10
- requireTrueValue(type);
11
- return 'commonjs';
12
- }
13
-
14
- case 'mjs': {
15
- requireTrueValue(type);
16
- return 'module';
17
- }
18
-
19
- case 'js': {
20
- requireTrueValue(type);
21
- return defaultModuleType;
22
- }
23
-
24
- default: {
25
- if (type !== 'commonjs' && type !== 'module') {
26
- throw new TypeError(`Module type for ’${extension}’ must be ’commonjs’ or ’module’`);
27
- }
28
-
29
- return type;
30
- }
31
- }
32
- };
33
-
34
- const deriveFromObject = (extensionsObject, defaultModuleType) => {
35
- const moduleTypes = {};
36
- for (const [extension, type] of Object.entries(extensionsObject)) {
37
- moduleTypes[extension] = normalize(extension, type, defaultModuleType);
38
- }
39
-
40
- return moduleTypes;
41
- };
42
-
43
- const deriveFromArray = (extensions, defaultModuleType) => {
44
- const moduleTypes = {};
45
- for (const extension of extensions) {
46
- switch (extension) {
47
- case 'cjs': {
48
- moduleTypes.cjs = 'commonjs';
49
- break;
50
- }
51
-
52
- case 'mjs': {
53
- moduleTypes.mjs = 'module';
54
- break;
55
- }
56
-
57
- case 'js': {
58
- moduleTypes.js = defaultModuleType;
59
- break;
60
- }
61
-
62
- default: {
63
- moduleTypes[extension] = 'commonjs';
64
- }
65
- }
66
- }
67
-
68
- return moduleTypes;
69
- };
70
-
71
- export default function moduleTypes(configuredExtensions, defaultModuleType) {
72
- if (configuredExtensions === undefined) {
73
- return {
74
- cjs: 'commonjs',
75
- mjs: 'module',
76
- js: defaultModuleType,
77
- };
78
- }
79
-
80
- if (Array.isArray(configuredExtensions)) {
81
- return deriveFromArray(configuredExtensions, defaultModuleType);
82
- }
83
-
84
- return deriveFromObject(configuredExtensions, defaultModuleType);
85
- }
package/lib/pkg.cjs DELETED
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- module.exports = require('../package.json');
package/lib/slash.cjs DELETED
@@ -1,36 +0,0 @@
1
- /*
2
- Inlined from
3
- <https://github.com/sindresorhus/slash/blob/98b618f5a3bfcb5dd374b204868818845b87bb2f/index.js>,
4
- since we need a CJS version.
5
-
6
- Copyright 2023 Sindre Sorhus
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy of
9
- this software and associated documentation files (the “Software”), to deal in
10
- the Software without restriction, including without limitation the rights to
11
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12
- the Software, and to permit persons to whom the Software is furnished to do so,
13
- subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in all
16
- copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
- */
25
-
26
- function slash(path) {
27
- const isExtendedLengthPath = path.startsWith('\\\\?\\');
28
-
29
- if (isExtendedLengthPath) {
30
- return path;
31
- }
32
-
33
- return path.replaceAll('\\', '/');
34
- }
35
-
36
- module.exports = slash;
@@ -1,12 +0,0 @@
1
- 'use strict';
2
- require('./guard-environment.cjs'); // eslint-disable-line import-x/no-unassigned-import
3
-
4
- const assert = require('node:assert');
5
-
6
- const {flags, refs} = require('./state.cjs');
7
-
8
- assert(refs.runnerChain);
9
-
10
- flags.loadedMain = true;
11
-
12
- module.exports = refs.runnerChain;
@@ -1,6 +0,0 @@
1
- 'use strict';
2
- exports.flags = {loadedMain: false};
3
- exports.refs = {runnerChain: null};
4
- exports.completionHandlers = [];
5
- exports.sharedWorkerTeardowns = [];
6
- exports.waitForReady = [];
@@ -1,6 +0,0 @@
1
- 'use strict';
2
- const process = require('node:process');
3
- const {isMainThread} = require('node:worker_threads');
4
-
5
- exports.isRunningInThread = isMainThread === false;
6
- exports.isRunningInChildProcess = typeof process.send === 'function';
File without changes
File without changes
File without changes