vitest 0.0.94 → 0.0.95
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/cli.js +3 -3
- package/dist/{index-de606d4a.js → index-ece64e3c.js} +4 -4
- package/dist/node.js +2 -2
- package/dist/worker.js +1298 -327
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import require$$0 from 'readline';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { c, e as ensurePackageInstalled } from './utils-576876dc.js';
|
|
4
|
-
import { c as createVitest } from './index-
|
|
4
|
+
import { c as createVitest } from './index-ece64e3c.js';
|
|
5
5
|
import 'tty';
|
|
6
6
|
import 'local-pkg';
|
|
7
7
|
import 'path';
|
|
@@ -18,7 +18,7 @@ import 'source-map';
|
|
|
18
18
|
import './index-5cc247ff.js';
|
|
19
19
|
import 'assert';
|
|
20
20
|
import 'worker_threads';
|
|
21
|
-
import '
|
|
21
|
+
import 'tinypool';
|
|
22
22
|
|
|
23
23
|
function toArr(any) {
|
|
24
24
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -633,7 +633,7 @@ class CAC extends EventEmitter {
|
|
|
633
633
|
|
|
634
634
|
const cac = (name = "") => new CAC(name);
|
|
635
635
|
|
|
636
|
-
var version = "0.0.
|
|
636
|
+
var version = "0.0.95";
|
|
637
637
|
|
|
638
638
|
const cli = cac("vitest");
|
|
639
639
|
cli.version(version).option("-r, --root <path>", "root path").option("-c, --config <path>", "path to config file").option("-u, --update", "update snapshot").option("-w, --watch", "watch mode").option("-o, --open", "open Vitest UI").option("--api", "listen to port and serve API").option("--threads", "enabled threads", { default: true }).option("--silent", "silent").option("--global", "inject apis globally").option("--dom", "mock browser api with happy-dom").option("--environment <env>", "runner environment", {
|
|
@@ -11,7 +11,7 @@ import { s as stringWidth, a as ansiStyles, b as stripAnsi, c as sliceAnsi, F as
|
|
|
11
11
|
import { o as onetime, s as signalExit } from './index-5cc247ff.js';
|
|
12
12
|
import { MessageChannel } from 'worker_threads';
|
|
13
13
|
import { pathToFileURL } from 'url';
|
|
14
|
-
import
|
|
14
|
+
import { Tinypool } from 'tinypool';
|
|
15
15
|
|
|
16
16
|
/*
|
|
17
17
|
How it works:
|
|
@@ -5263,7 +5263,7 @@ function createWorkerPool(ctx) {
|
|
|
5263
5263
|
options.maxThreads = ctx.config.maxThreads;
|
|
5264
5264
|
if (ctx.config.minThreads != null)
|
|
5265
5265
|
options.minThreads = ctx.config.minThreads;
|
|
5266
|
-
const
|
|
5266
|
+
const pool = new Tinypool(options);
|
|
5267
5267
|
const runWithFiles = (name) => {
|
|
5268
5268
|
return async (files, invalidates) => {
|
|
5269
5269
|
await Promise.all(files.map(async (file) => {
|
|
@@ -5274,7 +5274,7 @@ function createWorkerPool(ctx) {
|
|
|
5274
5274
|
files: [file],
|
|
5275
5275
|
invalidates
|
|
5276
5276
|
};
|
|
5277
|
-
await
|
|
5277
|
+
await pool.run(data, { transferList: [workerPort], name });
|
|
5278
5278
|
port.close();
|
|
5279
5279
|
workerPort.close();
|
|
5280
5280
|
}));
|
|
@@ -5283,7 +5283,7 @@ function createWorkerPool(ctx) {
|
|
|
5283
5283
|
return {
|
|
5284
5284
|
runTests: runWithFiles("run"),
|
|
5285
5285
|
collectTests: runWithFiles("collect"),
|
|
5286
|
-
close: () =>
|
|
5286
|
+
close: () => pool.destroy()
|
|
5287
5287
|
};
|
|
5288
5288
|
}
|
|
5289
5289
|
function createChannel(ctx) {
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as createVitest } from './index-
|
|
1
|
+
export { c as createVitest } from './index-ece64e3c.js';
|
|
2
2
|
import 'path';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'process';
|
|
@@ -17,4 +17,4 @@ import './index-5cc247ff.js';
|
|
|
17
17
|
import 'assert';
|
|
18
18
|
import 'events';
|
|
19
19
|
import 'worker_threads';
|
|
20
|
-
import '
|
|
20
|
+
import 'tinypool';
|