vitest 0.0.62 → 0.0.66
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 +11 -15
- package/dist/chunk-5TNYWP3O.js +81 -0
- package/dist/chunk-ANPMHBIF.js +253 -0
- package/dist/chunk-APGELTDH.js +19 -0
- package/dist/chunk-R2SMNEBL.js +95 -0
- package/dist/chunk-VLGIKNLC.js +78 -0
- package/dist/chunk-XUIDSY4V.js +35 -0
- package/dist/chunk-YPKHVZRP.js +86 -0
- package/dist/global-PRFYLY7P.js +22 -0
- package/dist/index.d.ts +33 -10
- package/dist/index.js +46 -1
- package/dist/node/cli.d.ts +0 -12
- package/dist/node/cli.js +2609 -19
- package/dist/{types-c0d293d3.d.ts → options-63a726fa.d.ts} +133 -148
- package/dist/runtime/entry.d.ts +1 -3
- package/dist/runtime/entry.js +2535 -9
- package/dist/{node → runtime}/worker.d.ts +4 -5
- package/dist/runtime/worker.js +263 -0
- package/package.json +40 -27
- package/dist/chunk-4HLM7BTV.js +0 -1
- package/dist/chunk-JKSYS65D.js +0 -1
- package/dist/chunk-LNO4ZIPT.js +0 -1
- package/dist/chunk-NTRHKVSE.js +0 -1
- package/dist/global-GT6TCEAH.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-ANPMHBIF.js";
|
|
14
|
+
import {
|
|
15
|
+
__export,
|
|
16
|
+
init_esm_shims
|
|
17
|
+
} from "./chunk-R2SMNEBL.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,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
src_exports
|
|
3
|
+
} from "./chunk-YPKHVZRP.js";
|
|
4
|
+
import {
|
|
5
|
+
globalApis
|
|
6
|
+
} from "./chunk-XUIDSY4V.js";
|
|
7
|
+
import "./chunk-ANPMHBIF.js";
|
|
8
|
+
import "./chunk-APGELTDH.js";
|
|
9
|
+
import {
|
|
10
|
+
init_esm_shims
|
|
11
|
+
} from "./chunk-R2SMNEBL.js";
|
|
12
|
+
|
|
13
|
+
// src/integrations/global.ts
|
|
14
|
+
init_esm_shims();
|
|
15
|
+
function registerApiGlobally() {
|
|
16
|
+
globalApis.forEach((api) => {
|
|
17
|
+
globalThis[api] = src_exports[api];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
registerApiGlobally
|
|
22
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,36 @@
|
|
|
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-63a726fa';
|
|
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-63a726fa';
|
|
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 'worker_threads';
|
|
7
|
-
import '@antfu/utils';
|
|
8
|
-
import 'vite';
|
|
9
8
|
import 'pretty-format';
|
|
10
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
|
+
};
|
|
33
|
+
|
|
11
34
|
declare const suite: {
|
|
12
35
|
(suiteName: string, factory?: TestFactory | undefined): SuiteCollector;
|
|
13
36
|
concurrent: {
|
|
@@ -99,10 +122,10 @@ declare const it: {
|
|
|
99
122
|
concurrent(name: string): void;
|
|
100
123
|
};
|
|
101
124
|
};
|
|
102
|
-
declare const beforeAll: (fn: SuiteHooks['beforeAll'][0], timeout?: number) => void;
|
|
103
|
-
declare const afterAll: (fn: SuiteHooks['afterAll'][0], timeout?: number) => void;
|
|
104
|
-
declare const beforeEach: (fn: SuiteHooks['beforeEach'][0], timeout?: number) => void;
|
|
105
|
-
declare const afterEach: (fn: SuiteHooks['afterEach'][0], timeout?: number) => void;
|
|
125
|
+
declare const beforeAll: (fn: SuiteHooks['beforeAll'][0], timeout?: number | undefined) => void;
|
|
126
|
+
declare const afterAll: (fn: SuiteHooks['afterAll'][0], timeout?: number | undefined) => void;
|
|
127
|
+
declare const beforeEach: (fn: SuiteHooks['beforeEach'][0], timeout?: number | undefined) => void;
|
|
128
|
+
declare const afterEach: (fn: SuiteHooks['afterEach'][0], timeout?: number | undefined) => void;
|
|
106
129
|
declare function clearContext(): void;
|
|
107
130
|
|
|
108
131
|
declare const mock: sinon.SinonMockStatic;
|
|
@@ -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-YPKHVZRP.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-ANPMHBIF.js";
|
|
24
|
+
import "./chunk-APGELTDH.js";
|
|
25
|
+
import "./chunk-R2SMNEBL.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,13 +1 @@
|
|
|
1
|
-
import { V as VitestContext } from '../types-c0d293d3';
|
|
2
|
-
import 'worker_threads';
|
|
3
|
-
import '@antfu/utils';
|
|
4
|
-
import 'vite';
|
|
5
|
-
import 'pretty-format';
|
|
6
1
|
|
|
7
|
-
declare global {
|
|
8
|
-
namespace NodeJS {
|
|
9
|
-
interface Process {
|
|
10
|
-
__vitest__: VitestContext;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|