vitest 0.0.61 → 0.0.65
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/LICENSE +2 -1
- package/README.gh.md +10 -14
- package/dist/chunk-3GMBTS5G.js +19 -0
- package/dist/chunk-LRXUKIDM.js +246 -0
- package/dist/chunk-NK2VTQLQ.js +81 -0
- package/dist/chunk-RNHB4AXG.js +128 -0
- package/dist/chunk-SF66BJ42.js +78 -0
- package/dist/chunk-VAUJEKEW.js +86 -0
- package/dist/global-OS2VOPCA.js +20 -0
- package/dist/index.d.ts +32 -9
- package/dist/index.js +46 -1
- package/dist/node/cli.d.ts +2 -4
- package/dist/node/cli.js +2000 -19
- package/dist/{types-31dc4f04.d.ts → options-652352ad.d.ts} +157 -139
- package/dist/runtime/entry.d.ts +2 -4
- package/dist/runtime/entry.js +2545 -1
- package/dist/{node → runtime}/worker.d.ts +5 -6
- package/dist/runtime/worker.js +261 -0
- package/package.json +41 -28
- package/dist/chunk-2AYT2TPD.js +0 -1
- package/dist/chunk-2PVIVCXM.js +0 -1
- package/dist/chunk-4STHXS4C.js +0 -1
- package/dist/chunk-64PJVUUV.js +0 -1
- package/dist/chunk-BC6SKI3B.js +0 -1
- package/dist/chunk-SLHZBXI2.js +0 -1
- package/dist/global-PPDEK7CI.js +0 -1
- package/dist/happy-dom-EZVJENUI.js +0 -1
- package/dist/jsdom-VHB26LUJ.js +0 -1
- package/dist/node/worker.js +0 -4
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterAll,
|
|
3
|
+
afterEach,
|
|
4
|
+
beforeAll,
|
|
5
|
+
beforeEach,
|
|
6
|
+
clearContext,
|
|
7
|
+
createSuiteHooks,
|
|
8
|
+
defaultSuite,
|
|
9
|
+
describe,
|
|
10
|
+
it,
|
|
11
|
+
suite,
|
|
12
|
+
test
|
|
13
|
+
} from "./chunk-LRXUKIDM.js";
|
|
14
|
+
import {
|
|
15
|
+
__export,
|
|
16
|
+
init_esm_shims
|
|
17
|
+
} from "./chunk-RNHB4AXG.js";
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var src_exports = {};
|
|
21
|
+
__export(src_exports, {
|
|
22
|
+
afterAll: () => afterAll,
|
|
23
|
+
afterEach: () => afterEach,
|
|
24
|
+
assert: () => assert,
|
|
25
|
+
beforeAll: () => beforeAll,
|
|
26
|
+
beforeEach: () => beforeEach,
|
|
27
|
+
chai: () => chai,
|
|
28
|
+
clearContext: () => clearContext,
|
|
29
|
+
createSuiteHooks: () => createSuiteHooks,
|
|
30
|
+
defaultSuite: () => defaultSuite,
|
|
31
|
+
describe: () => describe,
|
|
32
|
+
expect: () => expect,
|
|
33
|
+
it: () => it,
|
|
34
|
+
mock: () => mock,
|
|
35
|
+
should: () => should,
|
|
36
|
+
sinon: () => sinon,
|
|
37
|
+
spy: () => spy,
|
|
38
|
+
stub: () => stub,
|
|
39
|
+
suite: () => suite,
|
|
40
|
+
test: () => test
|
|
41
|
+
});
|
|
42
|
+
init_esm_shims();
|
|
43
|
+
|
|
44
|
+
// src/types/index.ts
|
|
45
|
+
init_esm_shims();
|
|
46
|
+
|
|
47
|
+
// src/types/options.ts
|
|
48
|
+
init_esm_shims();
|
|
49
|
+
|
|
50
|
+
// src/types/tasks.ts
|
|
51
|
+
init_esm_shims();
|
|
52
|
+
|
|
53
|
+
// src/types/reporter.ts
|
|
54
|
+
init_esm_shims();
|
|
55
|
+
|
|
56
|
+
// src/types/snapshot.ts
|
|
57
|
+
init_esm_shims();
|
|
58
|
+
|
|
59
|
+
// src/types/worker.ts
|
|
60
|
+
init_esm_shims();
|
|
61
|
+
|
|
62
|
+
// src/types/general.ts
|
|
63
|
+
init_esm_shims();
|
|
64
|
+
|
|
65
|
+
// src/integrations/chai/index.ts
|
|
66
|
+
init_esm_shims();
|
|
67
|
+
import chai from "chai";
|
|
68
|
+
import { assert, should, expect } from "chai";
|
|
69
|
+
|
|
70
|
+
// src/integrations/sinon.ts
|
|
71
|
+
init_esm_shims();
|
|
72
|
+
import sinon from "sinon";
|
|
73
|
+
var { mock, spy, stub } = sinon;
|
|
74
|
+
sinon.fn = sinon.spy;
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
chai,
|
|
78
|
+
assert,
|
|
79
|
+
should,
|
|
80
|
+
expect,
|
|
81
|
+
sinon,
|
|
82
|
+
mock,
|
|
83
|
+
spy,
|
|
84
|
+
stub,
|
|
85
|
+
src_exports
|
|
86
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
src_exports
|
|
3
|
+
} from "./chunk-VAUJEKEW.js";
|
|
4
|
+
import "./chunk-LRXUKIDM.js";
|
|
5
|
+
import "./chunk-3GMBTS5G.js";
|
|
6
|
+
import {
|
|
7
|
+
globalApis,
|
|
8
|
+
init_esm_shims
|
|
9
|
+
} from "./chunk-RNHB4AXG.js";
|
|
10
|
+
|
|
11
|
+
// src/integrations/global.ts
|
|
12
|
+
init_esm_shims();
|
|
13
|
+
function registerApiGlobally() {
|
|
14
|
+
globalApis.forEach((api) => {
|
|
15
|
+
globalThis[api] = src_exports[api];
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
registerApiGlobally
|
|
20
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,35 @@
|
|
|
1
|
-
import { T as
|
|
2
|
-
export { C as CliOptions,
|
|
1
|
+
import { R as ResolvedConfig, F as File, T as TaskResultPack, S as SnapshotResult, a as TestFactory, b as SuiteCollector, c as TestFunction, d as SuiteHooks, U as UserOptions } from './options-652352ad';
|
|
2
|
+
export { u as Arrayable, A as Awaitable, C as CliOptions, g as ComputeMode, v as Environment, E as EnvironmentReturn, F as File, G as GlobalContext, H as HookListener, M as ModuleCache, N as Nullable, n as Reporter, R as ResolvedConfig, e as RunMode, o as SnapshotData, r as SnapshotMatchOptions, S as SnapshotResult, q as SnapshotStateOptions, t as SnapshotSummary, p as SnapshotUpdateState, j as Suite, b as SuiteCollector, d as SuiteHooks, l as Task, h as TaskBase, i as TaskResult, T as TaskResultPack, f as TaskState, k as Test, m as TestCollector, a as TestFactory, c as TestFunction, s as UncheckedSnapshot, U as UserOptions, V as VitestContext } from './options-652352ad';
|
|
3
|
+
import { MessagePort } from 'worker_threads';
|
|
4
|
+
import { TransformResult } from 'vite';
|
|
3
5
|
export { assert, default as chai, expect, should } from 'chai';
|
|
4
6
|
import sinon from 'sinon';
|
|
5
7
|
export { default as sinon } from 'sinon';
|
|
6
|
-
import '
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import 'pretty-format';
|
|
9
|
+
|
|
10
|
+
interface WorkerContext {
|
|
11
|
+
port: MessagePort;
|
|
12
|
+
config: ResolvedConfig;
|
|
13
|
+
files: string[];
|
|
14
|
+
invalidates?: string[];
|
|
15
|
+
}
|
|
16
|
+
interface RpcMap {
|
|
17
|
+
workerReady: [[], void];
|
|
18
|
+
fetch: [[id: string], TransformResult | null | undefined];
|
|
19
|
+
onCollected: [[files: File[]], void];
|
|
20
|
+
onFinished: [[], void];
|
|
21
|
+
onTaskUpdate: [[pack: TaskResultPack], void];
|
|
22
|
+
onWatcherStart: [[], void];
|
|
23
|
+
onWatcherRerun: [[files: string[], trigger: string], void];
|
|
24
|
+
snapshotSaved: [[snapshot: SnapshotResult], void];
|
|
25
|
+
}
|
|
26
|
+
declare type RpcCall = <T extends keyof RpcMap>(method: T, ...args: RpcMap[T][0]) => Promise<RpcMap[T][1]>;
|
|
27
|
+
declare type RpcSend = <T extends keyof RpcMap>(method: T, ...args: RpcMap[T][0]) => void;
|
|
28
|
+
declare type RpcPayload<T extends keyof RpcMap = keyof RpcMap> = {
|
|
29
|
+
id: string;
|
|
30
|
+
method: T;
|
|
31
|
+
args: RpcMap[T][0];
|
|
32
|
+
};
|
|
10
33
|
|
|
11
34
|
declare const suite: {
|
|
12
35
|
(suiteName: string, factory?: TestFactory | undefined): SuiteCollector;
|
|
@@ -153,8 +176,8 @@ declare global {
|
|
|
153
176
|
nthCalledWith(n: number, ...args: any[]): void;
|
|
154
177
|
toHaveBeenLastCalledWith(...args: any[]): void;
|
|
155
178
|
lastCalledWith(...args: any[]): void;
|
|
156
|
-
toThrow(): void;
|
|
157
|
-
toThrowError(): void;
|
|
179
|
+
toThrow(expected?: string | RegExp): void;
|
|
180
|
+
toThrowError(expected?: string | RegExp): void;
|
|
158
181
|
toReturn(): void;
|
|
159
182
|
toHaveReturned(): void;
|
|
160
183
|
toReturnTimes(times: number): void;
|
|
@@ -169,4 +192,4 @@ declare global {
|
|
|
169
192
|
}
|
|
170
193
|
}
|
|
171
194
|
|
|
172
|
-
export { afterAll, afterEach, beforeAll, beforeEach, clearContext, createSuiteHooks, defaultSuite, describe, it, mock, spy, stub, suite, test };
|
|
195
|
+
export { RpcCall, RpcMap, RpcPayload, RpcSend, WorkerContext, afterAll, afterEach, beforeAll, beforeEach, clearContext, createSuiteHooks, defaultSuite, describe, it, mock, spy, stub, suite, test };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,46 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import {
|
|
2
|
+
assert,
|
|
3
|
+
chai,
|
|
4
|
+
expect,
|
|
5
|
+
mock,
|
|
6
|
+
should,
|
|
7
|
+
sinon,
|
|
8
|
+
spy,
|
|
9
|
+
stub
|
|
10
|
+
} from "./chunk-VAUJEKEW.js";
|
|
11
|
+
import {
|
|
12
|
+
afterAll,
|
|
13
|
+
afterEach,
|
|
14
|
+
beforeAll,
|
|
15
|
+
beforeEach,
|
|
16
|
+
clearContext,
|
|
17
|
+
createSuiteHooks,
|
|
18
|
+
defaultSuite,
|
|
19
|
+
describe,
|
|
20
|
+
it,
|
|
21
|
+
suite,
|
|
22
|
+
test
|
|
23
|
+
} from "./chunk-LRXUKIDM.js";
|
|
24
|
+
import "./chunk-3GMBTS5G.js";
|
|
25
|
+
import "./chunk-RNHB4AXG.js";
|
|
26
|
+
export {
|
|
27
|
+
afterAll,
|
|
28
|
+
afterEach,
|
|
29
|
+
assert,
|
|
30
|
+
beforeAll,
|
|
31
|
+
beforeEach,
|
|
32
|
+
chai,
|
|
33
|
+
clearContext,
|
|
34
|
+
createSuiteHooks,
|
|
35
|
+
defaultSuite,
|
|
36
|
+
describe,
|
|
37
|
+
expect,
|
|
38
|
+
it,
|
|
39
|
+
mock,
|
|
40
|
+
should,
|
|
41
|
+
sinon,
|
|
42
|
+
spy,
|
|
43
|
+
stub,
|
|
44
|
+
suite,
|
|
45
|
+
test
|
|
46
|
+
};
|
package/dist/node/cli.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { V as VitestContext } from '../
|
|
2
|
-
import 'worker_threads';
|
|
3
|
-
import '@antfu/utils';
|
|
1
|
+
import { V as VitestContext } from '../options-652352ad';
|
|
4
2
|
import 'vite';
|
|
5
|
-
import '
|
|
3
|
+
import 'pretty-format';
|
|
6
4
|
|
|
7
5
|
declare global {
|
|
8
6
|
namespace NodeJS {
|