vitest 0.0.68 → 0.0.72
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/bin/vitest.mjs +3 -3
- package/dist/cli.js +2451 -0
- package/dist/constants-d4c70610.js +25 -0
- package/dist/entry.js +3755 -0
- package/dist/error-fb6ff2e6.js +1415 -0
- package/dist/global-e40b54d6.js +16 -0
- package/dist/index-6427e0f2.js +12 -0
- package/dist/index-e37648e9.js +31 -0
- package/dist/index.d.ts +412 -5
- package/dist/index.js +5 -46
- package/dist/{chunk-ANPMHBIF.js → suite-819c135e.js} +16 -45
- package/dist/{chunk-5TNYWP3O.js → utils-9dcc4050.js} +1 -18
- package/dist/{runtime/worker.js → worker.js} +44 -48
- package/global.d.ts +0 -1
- package/package.json +14 -8
- package/dist/chunk-APGELTDH.js +0 -19
- package/dist/chunk-R2SMNEBL.js +0 -95
- package/dist/chunk-VLGIKNLC.js +0 -78
- package/dist/chunk-XUIDSY4V.js +0 -35
- package/dist/chunk-YPKHVZRP.js +0 -86
- package/dist/global-PRFYLY7P.js +0 -22
- package/dist/node/cli.d.ts +0 -1
- package/dist/node/cli.js +0 -2612
- package/dist/options-63a726fa.d.ts +0 -294
- package/dist/runtime/entry.d.ts +0 -7
- package/dist/runtime/entry.js +0 -2545
- package/dist/runtime/worker.d.ts +0 -23
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
nanoid
|
|
9
|
-
} from "../chunk-APGELTDH.js";
|
|
10
|
-
import {
|
|
11
|
-
init_esm_shims
|
|
12
|
-
} from "../chunk-R2SMNEBL.js";
|
|
1
|
+
import { resolve, dirname } from 'path';
|
|
2
|
+
import { n as nanoid } from './index-6427e0f2.js';
|
|
3
|
+
import { b as distDir } from './constants-d4c70610.js';
|
|
4
|
+
import { builtinModules, createRequire } from 'module';
|
|
5
|
+
import { pathToFileURL, fileURLToPath } from 'url';
|
|
6
|
+
import vm from 'vm';
|
|
7
|
+
import { s as slash } from './utils-9dcc4050.js';
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
init_esm_shims();
|
|
16
|
-
import { resolve as resolve2 } from "path";
|
|
17
|
-
|
|
18
|
-
// src/node/execute.ts
|
|
19
|
-
init_esm_shims();
|
|
20
|
-
import { builtinModules, createRequire } from "module";
|
|
21
|
-
import { fileURLToPath, pathToFileURL } from "url";
|
|
22
|
-
import { dirname, resolve } from "path";
|
|
23
|
-
import vm from "vm";
|
|
24
|
-
var defaultInline = [
|
|
9
|
+
const defaultInline = [
|
|
25
10
|
"vitest/dist",
|
|
26
11
|
"@vue",
|
|
27
12
|
"@vueuse",
|
|
@@ -32,11 +17,11 @@ var defaultInline = [
|
|
|
32
17
|
/\/esm\/.*\.js$/,
|
|
33
18
|
/\.(es|esm|esm-browser|esm-bundler|es6).js$/
|
|
34
19
|
];
|
|
35
|
-
|
|
20
|
+
const depsExternal = [
|
|
36
21
|
/\.cjs.js$/
|
|
37
22
|
];
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
const isWindows = process.platform === "win32";
|
|
24
|
+
const stubRequests = {
|
|
40
25
|
"/@vite/client": {
|
|
41
26
|
injectQuery: (id) => id,
|
|
42
27
|
createHotContext() {
|
|
@@ -68,8 +53,20 @@ async function interpretedImport(path, interpretDefault) {
|
|
|
68
53
|
}
|
|
69
54
|
return mod;
|
|
70
55
|
}
|
|
56
|
+
let SOURCEMAPPING_URL = "sourceMa";
|
|
57
|
+
SOURCEMAPPING_URL += "ppingURL";
|
|
58
|
+
async function withInlineSourcemap(result) {
|
|
59
|
+
const { code, map } = result;
|
|
60
|
+
if (code.includes(`${SOURCEMAPPING_URL}=`))
|
|
61
|
+
return result;
|
|
62
|
+
if (map)
|
|
63
|
+
result.code = `${code}
|
|
64
|
+
|
|
65
|
+
//# ${SOURCEMAPPING_URL}=data:application/json;charset=utf-8;base64,${Buffer.from(JSON.stringify(map), "utf-8").toString("base64")}`;
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
71
68
|
async function executeInViteNode(options) {
|
|
72
|
-
const { moduleCache
|
|
69
|
+
const { moduleCache, root, files, fetch } = options;
|
|
73
70
|
const externaled = new Set(builtinModules);
|
|
74
71
|
const result = [];
|
|
75
72
|
for (const file of files)
|
|
@@ -81,11 +78,11 @@ async function executeInViteNode(options) {
|
|
|
81
78
|
var _a;
|
|
82
79
|
if (callstack.includes(dep)) {
|
|
83
80
|
const cacheKey = toFilePath(dep, root);
|
|
84
|
-
if (!((_a =
|
|
81
|
+
if (!((_a = moduleCache.get(cacheKey)) == null ? void 0 : _a.exports))
|
|
85
82
|
throw new Error(`Circular dependency detected
|
|
86
83
|
Stack:
|
|
87
84
|
${[...callstack, dep].reverse().map((p) => `- ${p}`).join("\n")}`);
|
|
88
|
-
return
|
|
85
|
+
return moduleCache.get(cacheKey).exports;
|
|
89
86
|
}
|
|
90
87
|
return cachedRequest(dep, callstack);
|
|
91
88
|
};
|
|
@@ -94,14 +91,16 @@ ${[...callstack, dep].reverse().map((p) => `- ${p}`).join("\n")}`);
|
|
|
94
91
|
const result2 = await fetch(id);
|
|
95
92
|
if (!result2)
|
|
96
93
|
throw new Error(`failed to load ${id}`);
|
|
94
|
+
if (process.env.NODE_V8_COVERAGE)
|
|
95
|
+
withInlineSourcemap(result2);
|
|
97
96
|
const url = pathToFileURL(fsPath).href;
|
|
98
97
|
const exports = {};
|
|
99
98
|
setCache(fsPath, { transformResult: result2, exports });
|
|
100
|
-
const
|
|
99
|
+
const __filename = fileURLToPath(url);
|
|
101
100
|
const context = {
|
|
102
101
|
require: createRequire(url),
|
|
103
|
-
__filename
|
|
104
|
-
__dirname: dirname(
|
|
102
|
+
__filename,
|
|
103
|
+
__dirname: dirname(__filename),
|
|
105
104
|
__vite_ssr_import__: request,
|
|
106
105
|
__vite_ssr_dynamic_import__: request,
|
|
107
106
|
__vite_ssr_exports__: exports,
|
|
@@ -117,10 +116,10 @@ ${[...callstack, dep].reverse().map((p) => `- ${p}`).join("\n")}`);
|
|
|
117
116
|
return exports;
|
|
118
117
|
}
|
|
119
118
|
function setCache(id, mod) {
|
|
120
|
-
if (!
|
|
121
|
-
|
|
119
|
+
if (!moduleCache.has(id))
|
|
120
|
+
moduleCache.set(id, mod);
|
|
122
121
|
else
|
|
123
|
-
Object.assign(
|
|
122
|
+
Object.assign(moduleCache.get(id), mod);
|
|
124
123
|
}
|
|
125
124
|
async function cachedRequest(rawId, callstack) {
|
|
126
125
|
var _a, _b;
|
|
@@ -133,8 +132,8 @@ ${[...callstack, dep].reverse().map((p) => `- ${p}`).join("\n")}`);
|
|
|
133
132
|
externaled.add(importPath);
|
|
134
133
|
return interpretedImport(importPath, options.interpretDefault);
|
|
135
134
|
}
|
|
136
|
-
if ((_a =
|
|
137
|
-
return (_b =
|
|
135
|
+
if ((_a = moduleCache.get(fsPath)) == null ? void 0 : _a.promise)
|
|
136
|
+
return (_b = moduleCache.get(fsPath)) == null ? void 0 : _b.promise;
|
|
138
137
|
const promise = directRequest(id, fsPath, callstack);
|
|
139
138
|
setCache(fsPath, { promise });
|
|
140
139
|
return await promise;
|
|
@@ -204,9 +203,8 @@ function patchWindowsImportPath(path) {
|
|
|
204
203
|
return path;
|
|
205
204
|
}
|
|
206
205
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
var moduleCache = /* @__PURE__ */ new Map();
|
|
206
|
+
let _run;
|
|
207
|
+
const moduleCache = new Map();
|
|
210
208
|
async function init(ctx) {
|
|
211
209
|
if (_run)
|
|
212
210
|
return _run;
|
|
@@ -214,7 +212,7 @@ async function init(ctx) {
|
|
|
214
212
|
_run = (await executeInViteNode({
|
|
215
213
|
root: config.root,
|
|
216
214
|
files: [
|
|
217
|
-
|
|
215
|
+
resolve(distDir, "entry.js")
|
|
218
216
|
],
|
|
219
217
|
fetch(id) {
|
|
220
218
|
return process.__vitest_worker__.rpc("fetch", id);
|
|
@@ -229,13 +227,13 @@ async function init(ctx) {
|
|
|
229
227
|
async function run(ctx) {
|
|
230
228
|
process.stdout.write("\0");
|
|
231
229
|
const { config, port } = ctx;
|
|
232
|
-
const rpcPromiseMap =
|
|
230
|
+
const rpcPromiseMap = new Map();
|
|
233
231
|
process.__vitest_worker__ = {
|
|
234
232
|
config,
|
|
235
233
|
rpc: (method, ...args) => {
|
|
236
|
-
return new Promise((
|
|
234
|
+
return new Promise((resolve2, reject) => {
|
|
237
235
|
const id = nanoid();
|
|
238
|
-
rpcPromiseMap.set(id, { resolve:
|
|
236
|
+
rpcPromiseMap.set(id, { resolve: resolve2, reject });
|
|
239
237
|
port.postMessage({ method, args, id });
|
|
240
238
|
});
|
|
241
239
|
},
|
|
@@ -258,7 +256,5 @@ async function run(ctx) {
|
|
|
258
256
|
ctx.files.forEach((i) => moduleCache.delete(i));
|
|
259
257
|
return run2(ctx.files, ctx.config);
|
|
260
258
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
init
|
|
264
|
-
};
|
|
259
|
+
|
|
260
|
+
export { run as default, init };
|
package/global.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ declare global {
|
|
|
3
3
|
const test: typeof import('vitest')['test']
|
|
4
4
|
const describe: typeof import('vitest')['describe']
|
|
5
5
|
const it: typeof import('vitest')['it']
|
|
6
|
-
const chai: typeof import('vitest')['chai']
|
|
7
6
|
const expect: typeof import('vitest')['expect']
|
|
8
7
|
const assert: typeof import('vitest')['assert']
|
|
9
8
|
const sinon: typeof import('vitest')['sinon']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.72",
|
|
4
4
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -39,14 +39,13 @@
|
|
|
39
39
|
"*.d.ts"
|
|
40
40
|
],
|
|
41
41
|
"scripts": {
|
|
42
|
-
"build": "
|
|
42
|
+
"build": "rimraf dist && rollup -c",
|
|
43
43
|
"coverage": "node bin/vitest.mjs -r test/core --coverage",
|
|
44
|
-
"dev": "
|
|
44
|
+
"dev": "rollup -c -w src",
|
|
45
45
|
"docs": "npm -C docs run dev",
|
|
46
46
|
"docs:build": "npm -C docs run build",
|
|
47
47
|
"docs:serve": "npm -C docs run serve",
|
|
48
48
|
"lint": "eslint \"{src,test}/**/*.ts\"",
|
|
49
|
-
"prepare": "esmo scripts/generate-types.ts",
|
|
50
49
|
"prepublishOnly": "nr build",
|
|
51
50
|
"release": "bumpp --commit --push --tag && esmo scripts/publish.ts",
|
|
52
51
|
"test": "node bin/vitest.mjs -r test/core",
|
|
@@ -56,13 +55,14 @@
|
|
|
56
55
|
},
|
|
57
56
|
"dependencies": {
|
|
58
57
|
"@types/chai": "^4.3.0",
|
|
58
|
+
"@types/chai-subset": "^1.3.3",
|
|
59
|
+
"@types/sinon": "^10.0.6",
|
|
59
60
|
"@types/sinon-chai": "^3.2.6",
|
|
60
61
|
"chai": "^4.3.4",
|
|
61
62
|
"chai-subset": "^1.6.0",
|
|
62
63
|
"fast-glob": "^3.2.7",
|
|
63
|
-
"
|
|
64
|
+
"local-pkg": "^0.4.0",
|
|
64
65
|
"micromatch": "^4.0.4",
|
|
65
|
-
"picocolors": "^1.0.0",
|
|
66
66
|
"piscina": "^3.2.0",
|
|
67
67
|
"sinon": "^12.0.1",
|
|
68
68
|
"sinon-chai": "^3.7.0",
|
|
@@ -71,14 +71,16 @@
|
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@antfu/eslint-config": "^0.13.1",
|
|
73
73
|
"@antfu/ni": "^0.12.0",
|
|
74
|
-
"@
|
|
74
|
+
"@rollup/plugin-alias": "^3.1.8",
|
|
75
|
+
"@rollup/plugin-commonjs": "^21.0.1",
|
|
76
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
77
|
+
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
75
78
|
"@types/diff": "^5.0.1",
|
|
76
79
|
"@types/jsdom": "^16.2.13",
|
|
77
80
|
"@types/micromatch": "^4.0.2",
|
|
78
81
|
"@types/natural-compare": "^1.4.1",
|
|
79
82
|
"@types/node": "^16.11.12",
|
|
80
83
|
"@types/sade": "^1.7.3",
|
|
81
|
-
"@types/sinon": "^10.0.6",
|
|
82
84
|
"bumpp": "^7.1.1",
|
|
83
85
|
"c8": "^7.10.0",
|
|
84
86
|
"cac": "^6.7.12",
|
|
@@ -90,11 +92,15 @@
|
|
|
90
92
|
"find-up": "^6.2.0",
|
|
91
93
|
"happy-dom": "^2.24.5",
|
|
92
94
|
"jsdom": "^19.0.0",
|
|
95
|
+
"log-update": "^5.0.0",
|
|
93
96
|
"nanoid": "^3.1.30",
|
|
94
97
|
"natural-compare": "^1.4.0",
|
|
95
98
|
"npm-run-all": "^4.1.5",
|
|
99
|
+
"picocolors": "^1.0.0",
|
|
96
100
|
"pretty-format": "^27.4.2",
|
|
97
101
|
"rimraf": "^3.0.2",
|
|
102
|
+
"rollup-plugin-dts": "^4.0.1",
|
|
103
|
+
"rollup-plugin-esbuild": "^4.7.2",
|
|
98
104
|
"strip-ansi": "^7.0.1",
|
|
99
105
|
"tsup": "^5.11.1",
|
|
100
106
|
"typescript": "^4.5.3",
|
package/dist/chunk-APGELTDH.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_esm_shims
|
|
3
|
-
} from "./chunk-R2SMNEBL.js";
|
|
4
|
-
|
|
5
|
-
// node_modules/.pnpm/nanoid@3.1.30/node_modules/nanoid/non-secure/index.js
|
|
6
|
-
init_esm_shims();
|
|
7
|
-
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
8
|
-
var nanoid = (size = 21) => {
|
|
9
|
-
let id = "";
|
|
10
|
-
let i = size;
|
|
11
|
-
while (i--) {
|
|
12
|
-
id += urlAlphabet[Math.random() * 64 | 0];
|
|
13
|
-
}
|
|
14
|
-
return id;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
nanoid
|
|
19
|
-
};
|
package/dist/chunk-R2SMNEBL.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
|
-
var __esm = (fn, res) => function __init() {
|
|
26
|
-
return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
|
|
27
|
-
};
|
|
28
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
29
|
-
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
30
|
-
};
|
|
31
|
-
var __export = (target, all) => {
|
|
32
|
-
__markAsModule(target);
|
|
33
|
-
for (var name in all)
|
|
34
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
35
|
-
};
|
|
36
|
-
var __reExport = (target, module, desc) => {
|
|
37
|
-
if (module && typeof module === "object" || typeof module === "function") {
|
|
38
|
-
for (let key of __getOwnPropNames(module))
|
|
39
|
-
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
40
|
-
__defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
|
|
41
|
-
}
|
|
42
|
-
return target;
|
|
43
|
-
};
|
|
44
|
-
var __toModule = (module) => {
|
|
45
|
-
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
|
|
46
|
-
};
|
|
47
|
-
var __accessCheck = (obj, member, msg) => {
|
|
48
|
-
if (!member.has(obj))
|
|
49
|
-
throw TypeError("Cannot " + msg);
|
|
50
|
-
};
|
|
51
|
-
var __privateGet = (obj, member, getter) => {
|
|
52
|
-
__accessCheck(obj, member, "read from private field");
|
|
53
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
54
|
-
};
|
|
55
|
-
var __privateAdd = (obj, member, value) => {
|
|
56
|
-
if (member.has(obj))
|
|
57
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
58
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
59
|
-
};
|
|
60
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
61
|
-
__accessCheck(obj, member, "write to private field");
|
|
62
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
63
|
-
return value;
|
|
64
|
-
};
|
|
65
|
-
var __privateWrapper = (obj, member, setter, getter) => {
|
|
66
|
-
return {
|
|
67
|
-
set _(value) {
|
|
68
|
-
__privateSet(obj, member, value, setter);
|
|
69
|
-
},
|
|
70
|
-
get _() {
|
|
71
|
-
return __privateGet(obj, member, getter);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// node_modules/.pnpm/tsup@5.11.1_typescript@4.5.3/node_modules/tsup/assets/esm_shims.js
|
|
77
|
-
import { fileURLToPath } from "url";
|
|
78
|
-
import path from "path";
|
|
79
|
-
var init_esm_shims = __esm({
|
|
80
|
-
"node_modules/.pnpm/tsup@5.11.1_typescript@4.5.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
export {
|
|
85
|
-
__spreadValues,
|
|
86
|
-
__spreadProps,
|
|
87
|
-
__commonJS,
|
|
88
|
-
__export,
|
|
89
|
-
__toModule,
|
|
90
|
-
__privateGet,
|
|
91
|
-
__privateAdd,
|
|
92
|
-
__privateSet,
|
|
93
|
-
__privateWrapper,
|
|
94
|
-
init_esm_shims
|
|
95
|
-
};
|
package/dist/chunk-VLGIKNLC.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_esm_shims
|
|
3
|
-
} from "./chunk-R2SMNEBL.js";
|
|
4
|
-
|
|
5
|
-
// src/integrations/snapshot/port/jest-test-result-helper.ts
|
|
6
|
-
init_esm_shims();
|
|
7
|
-
var emptySummary = (options) => {
|
|
8
|
-
const summary = {
|
|
9
|
-
added: 0,
|
|
10
|
-
failure: false,
|
|
11
|
-
filesAdded: 0,
|
|
12
|
-
filesRemoved: 0,
|
|
13
|
-
filesRemovedList: [],
|
|
14
|
-
filesUnmatched: 0,
|
|
15
|
-
filesUpdated: 0,
|
|
16
|
-
matched: 0,
|
|
17
|
-
total: 0,
|
|
18
|
-
unchecked: 0,
|
|
19
|
-
uncheckedKeysByFile: [],
|
|
20
|
-
unmatched: 0,
|
|
21
|
-
updated: 0,
|
|
22
|
-
didUpdate: options.updateSnapshot === "all"
|
|
23
|
-
};
|
|
24
|
-
return summary;
|
|
25
|
-
};
|
|
26
|
-
var packSnapshotState = (filepath, state) => {
|
|
27
|
-
const snapshot = {
|
|
28
|
-
filepath,
|
|
29
|
-
added: 0,
|
|
30
|
-
fileDeleted: false,
|
|
31
|
-
matched: 0,
|
|
32
|
-
unchecked: 0,
|
|
33
|
-
uncheckedKeys: [],
|
|
34
|
-
unmatched: 0,
|
|
35
|
-
updated: 0
|
|
36
|
-
};
|
|
37
|
-
const uncheckedCount = state.getUncheckedCount();
|
|
38
|
-
const uncheckedKeys = state.getUncheckedKeys();
|
|
39
|
-
if (uncheckedCount)
|
|
40
|
-
state.removeUncheckedKeys();
|
|
41
|
-
const status = state.save();
|
|
42
|
-
snapshot.fileDeleted = status.deleted;
|
|
43
|
-
snapshot.added = state.added;
|
|
44
|
-
snapshot.matched = state.matched;
|
|
45
|
-
snapshot.unmatched = state.unmatched;
|
|
46
|
-
snapshot.updated = state.updated;
|
|
47
|
-
snapshot.unchecked = !status.deleted ? uncheckedCount : 0;
|
|
48
|
-
snapshot.uncheckedKeys = Array.from(uncheckedKeys);
|
|
49
|
-
return snapshot;
|
|
50
|
-
};
|
|
51
|
-
var addSnapshotResult = (summary, result) => {
|
|
52
|
-
if (result.added)
|
|
53
|
-
summary.filesAdded++;
|
|
54
|
-
if (result.fileDeleted)
|
|
55
|
-
summary.filesRemoved++;
|
|
56
|
-
if (result.unmatched)
|
|
57
|
-
summary.filesUnmatched++;
|
|
58
|
-
if (result.updated)
|
|
59
|
-
summary.filesUpdated++;
|
|
60
|
-
summary.added += result.added;
|
|
61
|
-
summary.matched += result.matched;
|
|
62
|
-
summary.unchecked += result.unchecked;
|
|
63
|
-
if (result.uncheckedKeys && result.uncheckedKeys.length > 0) {
|
|
64
|
-
summary.uncheckedKeysByFile.push({
|
|
65
|
-
filePath: result.filepath,
|
|
66
|
-
keys: result.uncheckedKeys
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
summary.unmatched += result.unmatched;
|
|
70
|
-
summary.updated += result.updated;
|
|
71
|
-
summary.total += result.added + result.matched + result.unmatched + result.updated;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export {
|
|
75
|
-
emptySummary,
|
|
76
|
-
packSnapshotState,
|
|
77
|
-
addSnapshotResult
|
|
78
|
-
};
|
package/dist/chunk-XUIDSY4V.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_esm_shims
|
|
3
|
-
} from "./chunk-R2SMNEBL.js";
|
|
4
|
-
|
|
5
|
-
// src/constants.ts
|
|
6
|
-
init_esm_shims();
|
|
7
|
-
import { resolve } from "path";
|
|
8
|
-
import { fileURLToPath } from "url";
|
|
9
|
-
var distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
|
|
10
|
-
var defaultIncludes = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
|
|
11
|
-
var defaultExcludes = ["**/node_modules/**", "**/dist/**"];
|
|
12
|
-
var globalApis = [
|
|
13
|
-
"suite",
|
|
14
|
-
"test",
|
|
15
|
-
"describe",
|
|
16
|
-
"it",
|
|
17
|
-
"chai",
|
|
18
|
-
"expect",
|
|
19
|
-
"assert",
|
|
20
|
-
"sinon",
|
|
21
|
-
"spy",
|
|
22
|
-
"mock",
|
|
23
|
-
"stub",
|
|
24
|
-
"beforeAll",
|
|
25
|
-
"afterAll",
|
|
26
|
-
"beforeEach",
|
|
27
|
-
"afterEach"
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
distDir,
|
|
32
|
-
defaultIncludes,
|
|
33
|
-
defaultExcludes,
|
|
34
|
-
globalApis
|
|
35
|
-
};
|
package/dist/chunk-YPKHVZRP.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/global-PRFYLY7P.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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/node/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|