vitest 0.0.85 → 0.0.90

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.0.85",
3
+ "version": "0.0.90",
4
4
  "description": "A blazing fast unit test framework powered by Vite",
5
5
  "keywords": [
6
6
  "vite",
@@ -56,14 +56,14 @@
56
56
  "micromatch": "^4.0.4",
57
57
  "piscina": "^3.2.0",
58
58
  "source-map": "^0.7.3",
59
- "tinyspy": "^0.0.13"
59
+ "tinyspy": "^0.1.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/diff": "^5.0.1",
63
63
  "@types/jsdom": "^16.2.13",
64
64
  "@types/micromatch": "^4.0.2",
65
65
  "@types/natural-compare": "^1.4.1",
66
- "@types/node": "^16.11.12",
66
+ "@types/node": "^16.11.13",
67
67
  "c8": "^7.10.0",
68
68
  "cac": "^6.7.12",
69
69
  "cli-truncate": "^3.1.0",
@@ -72,12 +72,16 @@
72
72
  "happy-dom": "^2.24.5",
73
73
  "jsdom": "^19.0.0",
74
74
  "log-update": "^5.0.0",
75
+ "mlly": "^0.3.15",
75
76
  "nanoid": "^3.1.30",
76
77
  "natural-compare": "^1.4.0",
78
+ "pathe": "^0.2.0",
77
79
  "picocolors": "^1.0.0",
80
+ "pkg-types": "^0.3.2",
78
81
  "pretty-format": "^27.4.2",
79
82
  "rollup": "^2.61.1",
80
- "strip-ansi": "^7.0.1"
83
+ "strip-ansi": "^7.0.1",
84
+ "typescript": "^4.5.4"
81
85
  },
82
86
  "peerDependencies": {
83
87
  "c8": "*",
@@ -103,5 +107,6 @@
103
107
  "build": "rimraf dist && rollup -c",
104
108
  "dev": "rollup -c --watch src",
105
109
  "typecheck": "tsc --noEmit"
106
- }
110
+ },
111
+ "readme": "# vitest\n\n[![NPM version](https://img.shields.io/npm/v/vitest?color=a1b858&label=)](https://www.npmjs.com/package/vitest)\n\nA blazing fast unit test framework powered by Vite.\n\n> **This project is currently in closed beta exclusively for Sponsors.**<br>\n> Become a Sponsor of [@patak-dev](https://github.com/sponsors/patak-dev) or [@antfu](https://github.com/sponsors/antfu) to access the source code and issues tracker.\n> Learn more at [vitest.dev](https://vitest.dev)\n"
107
112
  }
@@ -1,34 +0,0 @@
1
- import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it } from './suite-0e21bf9b.js';
2
- import chai, { assert, should, expect } from 'chai';
3
- import { spyOn, spy } from 'tinyspy';
4
-
5
- const beforeAll = (fn, timeout) => getCurrentSuite().on("beforeAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
6
- const afterAll = (fn, timeout) => getCurrentSuite().on("afterAll", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
7
- const beforeEach = (fn, timeout) => getCurrentSuite().on("beforeEach", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
8
- const afterEach = (fn, timeout) => getCurrentSuite().on("afterEach", withTimeout(fn, timeout ?? getDefaultHookTimeout()));
9
-
10
- const vitest = {
11
- spyOn,
12
- fn: spy
13
- };
14
-
15
- var index = /*#__PURE__*/Object.freeze({
16
- __proto__: null,
17
- suite: suite,
18
- test: test,
19
- describe: describe,
20
- it: it,
21
- beforeAll: beforeAll,
22
- afterAll: afterAll,
23
- beforeEach: beforeEach,
24
- afterEach: afterEach,
25
- assert: assert,
26
- should: should,
27
- expect: expect,
28
- chai: chai,
29
- spy: spy,
30
- spyOn: spyOn,
31
- vitest: vitest
32
- });
33
-
34
- export { afterAll as a, beforeAll as b, beforeEach as c, afterEach as d, index as i, vitest as v };
@@ -1,64 +0,0 @@
1
- function toArray(array) {
2
- array = array || [];
3
- if (Array.isArray(array))
4
- return array;
5
- return [array];
6
- }
7
- function notNullish(v) {
8
- return v != null;
9
- }
10
- function slash(str) {
11
- return str.replace(/\\/g, "/");
12
- }
13
- function partitionSuiteChildren(suite) {
14
- let tasksGroup = [];
15
- const tasksGroups = [];
16
- for (const c of suite.tasks) {
17
- if (tasksGroup.length === 0 || c.computeMode === tasksGroup[0].computeMode) {
18
- tasksGroup.push(c);
19
- } else {
20
- tasksGroups.push(tasksGroup);
21
- tasksGroup = [c];
22
- }
23
- }
24
- if (tasksGroup.length > 0)
25
- tasksGroups.push(tasksGroup);
26
- return tasksGroups;
27
- }
28
- function interpretOnlyMode(items) {
29
- if (items.some((i) => i.mode === "only")) {
30
- items.forEach((i) => {
31
- if (i.mode === "run")
32
- i.mode = "skip";
33
- else if (i.mode === "only")
34
- i.mode = "run";
35
- });
36
- }
37
- }
38
- function getTests(suite) {
39
- return toArray(suite).flatMap((s) => s.tasks.flatMap((c) => c.type === "test" ? [c] : getTests(c)));
40
- }
41
- function getSuites(suite) {
42
- return toArray(suite).flatMap((s) => s.type === "suite" ? [s, ...getSuites(s.tasks)] : []);
43
- }
44
- function hasTests(suite) {
45
- return toArray(suite).some((s) => s.tasks.some((c) => c.type === "test" || hasTests(c)));
46
- }
47
- function hasFailed(suite) {
48
- return toArray(suite).some((s) => {
49
- var _a;
50
- return ((_a = s.result) == null ? void 0 : _a.state) === "fail" || s.type === "suite" && hasFailed(s.tasks);
51
- });
52
- }
53
- function getNames(task) {
54
- const names = [task.name];
55
- let current = task;
56
- while ((current == null ? void 0 : current.suite) || (current == null ? void 0 : current.file)) {
57
- current = current.suite || current.file;
58
- if (current == null ? void 0 : current.name)
59
- names.unshift(current.name);
60
- }
61
- return names;
62
- }
63
-
64
- export { getTests as a, getSuites as b, hasTests as c, getNames as g, hasFailed as h, interpretOnlyMode as i, notNullish as n, partitionSuiteChildren as p, slash as s, toArray as t };