vitest 0.16.0 → 0.18.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.
- package/dist/{chunk-api-setup.f43cd039.mjs → chunk-api-setup.63babd7c.mjs} +4 -4
- package/dist/{chunk-constants.7b9cfc82.mjs → chunk-constants.8eb2ed35.mjs} +8 -2
- package/dist/chunk-env-node.26c72624.mjs +675 -0
- package/dist/{chunk-install-pkg.3fa50769.mjs → chunk-install-pkg.2dcb2c04.mjs} +1 -1
- package/dist/{chunk-integrations-globals.d0c363a6.mjs → chunk-integrations-globals.61e4d6ae.mjs} +8 -8
- package/dist/{chunk-runtime-chain.7103058b.mjs → chunk-runtime-chain.eb764dff.mjs} +55 -188
- package/dist/{chunk-runtime-mocker.110e3634.mjs → chunk-runtime-mocker.79ccc3de.mjs} +36 -62
- package/dist/{chunk-runtime-rpc.5e78af38.mjs → chunk-runtime-rpc.cc6a06a2.mjs} +1 -1
- package/dist/{chunk-utils-global.79a8b1cc.mjs → chunk-utils-global.1b22c4fd.mjs} +69 -5
- package/dist/{chunk-utils-source-map.2556cba8.mjs → chunk-utils-source-map.957e7756.mjs} +10 -24
- package/dist/{chunk-vite-node-externalize.58e10976.mjs → chunk-vite-node-externalize.0791f2ed.mjs} +2683 -2553
- package/dist/{chunk-vite-node-utils.7450fc0c.mjs → chunk-vite-node-utils.af8ead96.mjs} +28 -13
- package/dist/cli.mjs +15 -15
- package/dist/config.cjs +5 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +5 -1
- package/dist/entry.mjs +8 -8
- package/dist/index.d.ts +223 -18
- package/dist/index.mjs +4 -4
- package/dist/node.d.ts +236 -38
- package/dist/node.mjs +16 -16
- package/dist/{vendor-entry.efeeaa5c.mjs → vendor-entry.78de67ab.mjs} +18 -424
- package/dist/{vendor-index.e5dc6622.mjs → vendor-index.4bf9c627.mjs} +405 -405
- package/dist/{vendor-index.98e769c1.mjs → vendor-index.de788b6a.mjs} +7 -7
- package/dist/worker.mjs +8 -8
- package/package.json +9 -4
- package/dist/chunk-defaults.dc6dc23d.mjs +0 -302
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import require$$0 from 'readline';
|
|
2
2
|
import require$$2 from 'events';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -508,7 +508,7 @@ function requirePrompt$1 () {
|
|
|
508
508
|
if (hasRequiredPrompt$1) return prompt$1;
|
|
509
509
|
hasRequiredPrompt$1 = 1;
|
|
510
510
|
|
|
511
|
-
const readline
|
|
511
|
+
const readline = require$$0;
|
|
512
512
|
|
|
513
513
|
const _require = requireUtil$1(),
|
|
514
514
|
action = _require.action;
|
|
@@ -536,11 +536,11 @@ function requirePrompt$1 () {
|
|
|
536
536
|
|
|
537
537
|
this.onRender = (opts.onRender || (() => void 0)).bind(this);
|
|
538
538
|
|
|
539
|
-
const rl = readline
|
|
539
|
+
const rl = readline.createInterface({
|
|
540
540
|
input: this.in,
|
|
541
541
|
escapeCodeTimeout: 50
|
|
542
542
|
});
|
|
543
|
-
readline
|
|
543
|
+
readline.emitKeypressEvents(this.in, rl);
|
|
544
544
|
if (this.in.isTTY) this.in.setRawMode(true);
|
|
545
545
|
const isSelect = ['SelectPrompt', 'MultiselectPrompt'].indexOf(this.constructor.name) > -1;
|
|
546
546
|
|
|
@@ -3673,7 +3673,7 @@ function requirePrompt () {
|
|
|
3673
3673
|
if (hasRequiredPrompt) return prompt;
|
|
3674
3674
|
hasRequiredPrompt = 1;
|
|
3675
3675
|
|
|
3676
|
-
const readline
|
|
3676
|
+
const readline = require$$0;
|
|
3677
3677
|
const { action } = requireUtil();
|
|
3678
3678
|
const EventEmitter = require$$2;
|
|
3679
3679
|
const { beep, cursor } = requireSrc();
|
|
@@ -3692,8 +3692,8 @@ function requirePrompt () {
|
|
|
3692
3692
|
this.in = opts.stdin || process.stdin;
|
|
3693
3693
|
this.out = opts.stdout || process.stdout;
|
|
3694
3694
|
this.onRender = (opts.onRender || (() => void 0)).bind(this);
|
|
3695
|
-
const rl = readline
|
|
3696
|
-
readline
|
|
3695
|
+
const rl = readline.createInterface({ input:this.in, escapeCodeTimeout:50 });
|
|
3696
|
+
readline.emitKeypressEvents(this.in, rl);
|
|
3697
3697
|
|
|
3698
3698
|
if (this.in.isTTY) this.in.setRawMode(true);
|
|
3699
3699
|
const isSelect = [ 'SelectPrompt', 'MultiselectPrompt' ].indexOf(this.constructor.name) > -1;
|
package/dist/worker.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.
|
|
1
|
+
import { q as resolve, a as getWorkerState } from './chunk-utils-global.1b22c4fd.mjs';
|
|
2
|
+
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.af8ead96.mjs';
|
|
3
3
|
import { workerId } from 'tinypool';
|
|
4
|
-
import { d as distDir } from './chunk-constants.
|
|
5
|
-
import { e as executeInViteNode } from './chunk-runtime-mocker.
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
4
|
+
import { d as distDir } from './chunk-constants.8eb2ed35.mjs';
|
|
5
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.79ccc3de.mjs';
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.cc6a06a2.mjs';
|
|
7
7
|
import 'tty';
|
|
8
8
|
import 'local-pkg';
|
|
9
9
|
import 'path';
|
|
@@ -75,9 +75,9 @@ function init(ctx) {
|
|
|
75
75
|
})
|
|
76
76
|
};
|
|
77
77
|
if (ctx.invalidates) {
|
|
78
|
-
ctx.invalidates.forEach((
|
|
79
|
-
moduleCache.delete(
|
|
80
|
-
moduleCache.delete(`${
|
|
78
|
+
ctx.invalidates.forEach((fsPath) => {
|
|
79
|
+
moduleCache.delete(fsPath);
|
|
80
|
+
moduleCache.delete(`${fsPath}__mock`);
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
ctx.files.forEach((i) => moduleCache.delete(i));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"node": ">=v14.16.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
+
"@edge-runtime/vm": "*",
|
|
60
61
|
"@vitest/ui": "*",
|
|
61
62
|
"c8": "*",
|
|
62
63
|
"happy-dom": "*",
|
|
@@ -74,6 +75,9 @@
|
|
|
74
75
|
},
|
|
75
76
|
"jsdom": {
|
|
76
77
|
"optional": true
|
|
78
|
+
},
|
|
79
|
+
"@edge-runtime/vm": {
|
|
80
|
+
"optional": true
|
|
77
81
|
}
|
|
78
82
|
},
|
|
79
83
|
"dependencies": {
|
|
@@ -85,10 +89,11 @@
|
|
|
85
89
|
"local-pkg": "^0.4.1",
|
|
86
90
|
"tinypool": "^0.2.1",
|
|
87
91
|
"tinyspy": "^0.3.3",
|
|
88
|
-
"vite": "^2.9.12"
|
|
92
|
+
"vite": "^2.9.12 || ^3.0.0-0"
|
|
89
93
|
},
|
|
90
94
|
"devDependencies": {
|
|
91
95
|
"@antfu/install-pkg": "^0.1.0",
|
|
96
|
+
"@edge-runtime/vm": "1.1.0-beta.10",
|
|
92
97
|
"@sinonjs/fake-timers": "^9.1.2",
|
|
93
98
|
"@types/diff": "^5.0.2",
|
|
94
99
|
"@types/jsdom": "^16.2.14",
|
|
@@ -96,7 +101,7 @@
|
|
|
96
101
|
"@types/natural-compare": "^1.4.1",
|
|
97
102
|
"@types/prompts": "^2.4.0",
|
|
98
103
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
99
|
-
"@vitest/ui": "0.
|
|
104
|
+
"@vitest/ui": "0.18.0",
|
|
100
105
|
"birpc": "^0.2.3",
|
|
101
106
|
"c8": "^7.11.3",
|
|
102
107
|
"cac": "^6.7.12",
|
|
@@ -124,7 +129,7 @@
|
|
|
124
129
|
"source-map-js": "^1.0.2",
|
|
125
130
|
"strip-ansi": "^7.0.1",
|
|
126
131
|
"typescript": "^4.7.4",
|
|
127
|
-
"vite-node": "0.
|
|
132
|
+
"vite-node": "0.18.0",
|
|
128
133
|
"ws": "^8.8.0"
|
|
129
134
|
},
|
|
130
135
|
"scripts": {
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { existsSync, promises } from 'fs';
|
|
2
|
-
import { createRequire } from 'module';
|
|
3
|
-
import { pathToFileURL } from 'url';
|
|
4
|
-
import { C as toArray, m as resolve } from './chunk-utils-global.79a8b1cc.mjs';
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
How it works:
|
|
8
|
-
`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
class Node {
|
|
12
|
-
value;
|
|
13
|
-
next;
|
|
14
|
-
|
|
15
|
-
constructor(value) {
|
|
16
|
-
this.value = value;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
class Queue {
|
|
21
|
-
#head;
|
|
22
|
-
#tail;
|
|
23
|
-
#size;
|
|
24
|
-
|
|
25
|
-
constructor() {
|
|
26
|
-
this.clear();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
enqueue(value) {
|
|
30
|
-
const node = new Node(value);
|
|
31
|
-
|
|
32
|
-
if (this.#head) {
|
|
33
|
-
this.#tail.next = node;
|
|
34
|
-
this.#tail = node;
|
|
35
|
-
} else {
|
|
36
|
-
this.#head = node;
|
|
37
|
-
this.#tail = node;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
this.#size++;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
dequeue() {
|
|
44
|
-
const current = this.#head;
|
|
45
|
-
if (!current) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
this.#head = this.#head.next;
|
|
50
|
-
this.#size--;
|
|
51
|
-
return current.value;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
clear() {
|
|
55
|
-
this.#head = undefined;
|
|
56
|
-
this.#tail = undefined;
|
|
57
|
-
this.#size = 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
get size() {
|
|
61
|
-
return this.#size;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
* [Symbol.iterator]() {
|
|
65
|
-
let current = this.#head;
|
|
66
|
-
|
|
67
|
-
while (current) {
|
|
68
|
-
yield current.value;
|
|
69
|
-
current = current.next;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function pLimit(concurrency) {
|
|
75
|
-
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
76
|
-
throw new TypeError('Expected `concurrency` to be a number from 1 and up');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const queue = new Queue();
|
|
80
|
-
let activeCount = 0;
|
|
81
|
-
|
|
82
|
-
const next = () => {
|
|
83
|
-
activeCount--;
|
|
84
|
-
|
|
85
|
-
if (queue.size > 0) {
|
|
86
|
-
queue.dequeue()();
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const run = async (fn, resolve, args) => {
|
|
91
|
-
activeCount++;
|
|
92
|
-
|
|
93
|
-
const result = (async () => fn(...args))();
|
|
94
|
-
|
|
95
|
-
resolve(result);
|
|
96
|
-
|
|
97
|
-
try {
|
|
98
|
-
await result;
|
|
99
|
-
} catch {}
|
|
100
|
-
|
|
101
|
-
next();
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const enqueue = (fn, resolve, args) => {
|
|
105
|
-
queue.enqueue(run.bind(undefined, fn, resolve, args));
|
|
106
|
-
|
|
107
|
-
(async () => {
|
|
108
|
-
// This function needs to wait until the next microtask before comparing
|
|
109
|
-
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
|
110
|
-
// when the run function is dequeued and called. The comparison in the if-statement
|
|
111
|
-
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
|
112
|
-
await Promise.resolve();
|
|
113
|
-
|
|
114
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
115
|
-
queue.dequeue()();
|
|
116
|
-
}
|
|
117
|
-
})();
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const generator = (fn, ...args) => new Promise(resolve => {
|
|
121
|
-
enqueue(fn, resolve, args);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
Object.defineProperties(generator, {
|
|
125
|
-
activeCount: {
|
|
126
|
-
get: () => activeCount,
|
|
127
|
-
},
|
|
128
|
-
pendingCount: {
|
|
129
|
-
get: () => queue.size,
|
|
130
|
-
},
|
|
131
|
-
clearQueue: {
|
|
132
|
-
value: () => {
|
|
133
|
-
queue.clear();
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
return generator;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
|
|
142
|
-
const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
|
|
143
|
-
const defaultCoverageExcludes = [
|
|
144
|
-
"coverage/**",
|
|
145
|
-
"packages/*/test{,s}/**",
|
|
146
|
-
"**/*.d.ts",
|
|
147
|
-
"cypress/**",
|
|
148
|
-
"test{,s}/**",
|
|
149
|
-
"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}",
|
|
150
|
-
"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}",
|
|
151
|
-
"**/__tests__/**",
|
|
152
|
-
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc}.config.{js,cjs,mjs,ts}",
|
|
153
|
-
"**/.{eslint,mocha,prettier}rc.{js,cjs,yml}"
|
|
154
|
-
];
|
|
155
|
-
const coverageConfigDefaults = {
|
|
156
|
-
enabled: false,
|
|
157
|
-
clean: true,
|
|
158
|
-
cleanOnRerun: false,
|
|
159
|
-
reportsDirectory: "./coverage",
|
|
160
|
-
excludeNodeModules: true,
|
|
161
|
-
exclude: defaultCoverageExcludes,
|
|
162
|
-
reporter: ["text", "html"],
|
|
163
|
-
allowExternal: false,
|
|
164
|
-
extension: [".js", ".cjs", ".mjs", ".ts", ".tsx", ".jsx", ".vue", ".svelte"]
|
|
165
|
-
};
|
|
166
|
-
const fakeTimersDefaults = {
|
|
167
|
-
loopLimit: 1e4,
|
|
168
|
-
shouldClearNativeTimers: true,
|
|
169
|
-
toFake: [
|
|
170
|
-
"setTimeout",
|
|
171
|
-
"clearTimeout",
|
|
172
|
-
"setInterval",
|
|
173
|
-
"clearInterval",
|
|
174
|
-
"setImmediate",
|
|
175
|
-
"clearImmediate",
|
|
176
|
-
"Date"
|
|
177
|
-
]
|
|
178
|
-
};
|
|
179
|
-
const config = {
|
|
180
|
-
allowOnly: !process.env.CI,
|
|
181
|
-
watch: !process.env.CI,
|
|
182
|
-
globals: false,
|
|
183
|
-
environment: "node",
|
|
184
|
-
threads: true,
|
|
185
|
-
clearMocks: false,
|
|
186
|
-
restoreMocks: false,
|
|
187
|
-
mockReset: false,
|
|
188
|
-
include: defaultInclude,
|
|
189
|
-
exclude: defaultExclude,
|
|
190
|
-
testTimeout: 5e3,
|
|
191
|
-
hookTimeout: 1e4,
|
|
192
|
-
isolate: true,
|
|
193
|
-
watchExclude: ["**/node_modules/**", "**/dist/**"],
|
|
194
|
-
forceRerunTriggers: [],
|
|
195
|
-
update: false,
|
|
196
|
-
reporters: [],
|
|
197
|
-
silent: false,
|
|
198
|
-
api: false,
|
|
199
|
-
ui: false,
|
|
200
|
-
uiBase: "/__vitest__/",
|
|
201
|
-
open: true,
|
|
202
|
-
css: {
|
|
203
|
-
include: [/\.module\./]
|
|
204
|
-
},
|
|
205
|
-
coverage: coverageConfigDefaults,
|
|
206
|
-
fakeTimers: fakeTimersDefaults,
|
|
207
|
-
maxConcurrency: 5
|
|
208
|
-
};
|
|
209
|
-
const configDefaults = Object.freeze(config);
|
|
210
|
-
|
|
211
|
-
var __defProp = Object.defineProperty;
|
|
212
|
-
var __defProps = Object.defineProperties;
|
|
213
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
214
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
215
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
216
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
217
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
218
|
-
var __spreadValues = (a, b) => {
|
|
219
|
-
for (var prop in b || (b = {}))
|
|
220
|
-
if (__hasOwnProp.call(b, prop))
|
|
221
|
-
__defNormalProp(a, prop, b[prop]);
|
|
222
|
-
if (__getOwnPropSymbols)
|
|
223
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
224
|
-
if (__propIsEnum.call(b, prop))
|
|
225
|
-
__defNormalProp(a, prop, b[prop]);
|
|
226
|
-
}
|
|
227
|
-
return a;
|
|
228
|
-
};
|
|
229
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
230
|
-
function resolveC8Options(options, root) {
|
|
231
|
-
const resolved = __spreadValues(__spreadValues({}, configDefaults.coverage), options);
|
|
232
|
-
resolved.reporter = toArray(resolved.reporter);
|
|
233
|
-
resolved.reportsDirectory = resolve(root, resolved.reportsDirectory);
|
|
234
|
-
resolved.tempDirectory = process.env.NODE_V8_COVERAGE || resolve(resolved.reportsDirectory, "tmp");
|
|
235
|
-
return resolved;
|
|
236
|
-
}
|
|
237
|
-
async function cleanCoverage(options, clean = true) {
|
|
238
|
-
if (clean && existsSync(options.reportsDirectory))
|
|
239
|
-
await promises.rm(options.reportsDirectory, { recursive: true, force: true });
|
|
240
|
-
if (!existsSync(options.tempDirectory))
|
|
241
|
-
await promises.mkdir(options.tempDirectory, { recursive: true });
|
|
242
|
-
}
|
|
243
|
-
const require2 = createRequire(import.meta.url);
|
|
244
|
-
function takeCoverage() {
|
|
245
|
-
const v8 = require2("v8");
|
|
246
|
-
if (v8.takeCoverage == null)
|
|
247
|
-
console.warn("[Vitest] takeCoverage is not available in this NodeJs version.\nCoverage could be incomplete. Update to NodeJs 14.18.");
|
|
248
|
-
else
|
|
249
|
-
v8.takeCoverage();
|
|
250
|
-
}
|
|
251
|
-
async function reportCoverage(ctx) {
|
|
252
|
-
takeCoverage();
|
|
253
|
-
const createReport = require2("c8/lib/report");
|
|
254
|
-
const report = createReport(ctx.config.coverage);
|
|
255
|
-
const sourceMapMeta = {};
|
|
256
|
-
await Promise.all(Array.from(ctx.vitenode.fetchCache.entries()).filter((i) => !i[0].includes("/node_modules/")).map(async ([file, { result }]) => {
|
|
257
|
-
const map = result.map;
|
|
258
|
-
if (!map)
|
|
259
|
-
return;
|
|
260
|
-
const url = pathToFileURL(file).href;
|
|
261
|
-
let code;
|
|
262
|
-
try {
|
|
263
|
-
code = (await promises.readFile(file)).toString();
|
|
264
|
-
} catch {
|
|
265
|
-
}
|
|
266
|
-
const sources = [url];
|
|
267
|
-
sourceMapMeta[url] = {
|
|
268
|
-
source: result.code,
|
|
269
|
-
map: __spreadProps(__spreadValues({
|
|
270
|
-
sourcesContent: code ? [code] : void 0
|
|
271
|
-
}, map), {
|
|
272
|
-
sources
|
|
273
|
-
})
|
|
274
|
-
};
|
|
275
|
-
}));
|
|
276
|
-
const offset = 224;
|
|
277
|
-
report._getSourceMap = (coverage) => {
|
|
278
|
-
const path = pathToFileURL(coverage.url).href;
|
|
279
|
-
const data = sourceMapMeta[path];
|
|
280
|
-
if (!data)
|
|
281
|
-
return {};
|
|
282
|
-
return {
|
|
283
|
-
sourceMap: {
|
|
284
|
-
sourcemap: data.map
|
|
285
|
-
},
|
|
286
|
-
source: Array(offset).fill(".").join("") + data.source
|
|
287
|
-
};
|
|
288
|
-
};
|
|
289
|
-
await report.run();
|
|
290
|
-
if (ctx.config.coverage.enabled) {
|
|
291
|
-
if (ctx.config.coverage["100"]) {
|
|
292
|
-
ctx.config.coverage.lines = 100;
|
|
293
|
-
ctx.config.coverage.functions = 100;
|
|
294
|
-
ctx.config.coverage.branches = 100;
|
|
295
|
-
ctx.config.coverage.statements = 100;
|
|
296
|
-
}
|
|
297
|
-
const { checkCoverages } = require2("c8/lib/commands/check-coverage");
|
|
298
|
-
await checkCoverages(ctx.config.coverage, report);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export { cleanCoverage as a, reportCoverage as b, configDefaults as c, pLimit as p, resolveC8Options as r, takeCoverage as t };
|