vitest 0.0.9 → 0.0.10
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/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/defaultIncludes.d.ts +0 -0
- package/dist/defaultIncludes.js +1 -0
- package/dist/run.js +7 -2
- package/package.json +12 -11
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/run.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import chai from 'chai';
|
|
2
2
|
import fg from 'fast-glob';
|
|
3
|
+
import SinonChai from 'sinon-chai';
|
|
3
4
|
import { clearContext, defaultSuite } from './suite';
|
|
4
5
|
import { context } from './context';
|
|
5
6
|
import { afterEachHook, afterFileHook, afterAllHook, afterSuiteHook, beforeEachHook, beforeFileHook, beforeAllHook, beforeSuiteHook } from './hooks';
|
|
6
7
|
import { SnapshotPlugin } from './snapshot';
|
|
7
8
|
import { DefaultReporter } from './reporters/default';
|
|
9
|
+
import { defaultIncludes, defaultExcludes } from './constants';
|
|
8
10
|
export async function runTask(task, ctx) {
|
|
9
11
|
var _a, _b;
|
|
10
12
|
const { reporter } = ctx;
|
|
@@ -68,14 +70,17 @@ export async function runFile(file, ctx) {
|
|
|
68
70
|
export async function run(options = {}) {
|
|
69
71
|
var _a, _b, _c;
|
|
70
72
|
const { rootDir = process.cwd() } = options;
|
|
73
|
+
// setup chai
|
|
71
74
|
chai.use(await SnapshotPlugin({
|
|
72
75
|
rootDir,
|
|
73
76
|
update: options.updateSnapshot,
|
|
74
77
|
}));
|
|
75
|
-
|
|
78
|
+
chai.use(SinonChai);
|
|
79
|
+
// collect files
|
|
80
|
+
const paths = await fg(options.includes || defaultIncludes, {
|
|
76
81
|
absolute: true,
|
|
77
82
|
cwd: options.rootDir,
|
|
78
|
-
ignore: options.excludes ||
|
|
83
|
+
ignore: options.excludes || defaultExcludes,
|
|
79
84
|
});
|
|
80
85
|
if (!paths.length) {
|
|
81
86
|
console.error('No test files found');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -32,15 +32,6 @@
|
|
|
32
32
|
"bin": {
|
|
33
33
|
"vitest": "./bin/vitest.mjs"
|
|
34
34
|
},
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "tsc",
|
|
37
|
-
"watch": "tsc --watch",
|
|
38
|
-
"lint": "eslint \"{src,test}/**/*.ts\"",
|
|
39
|
-
"prepublishOnly": "nr build",
|
|
40
|
-
"release": "bumpp --commit --push --tag && pnpm publish",
|
|
41
|
-
"test": "node bin/vitest.mjs --dev",
|
|
42
|
-
"test:update": "nr test -u"
|
|
43
|
-
},
|
|
44
35
|
"devDependencies": {
|
|
45
36
|
"@antfu/eslint-config": "^0.11.1",
|
|
46
37
|
"@antfu/ni": "^0.11.0",
|
|
@@ -56,6 +47,7 @@
|
|
|
56
47
|
"dependencies": {
|
|
57
48
|
"@jest/test-result": "^27.4.2",
|
|
58
49
|
"@types/chai": "^4.2.22",
|
|
50
|
+
"@types/sinon-chai": "^3.2.6",
|
|
59
51
|
"chai": "^4.3.4",
|
|
60
52
|
"fast-glob": "^3.2.7",
|
|
61
53
|
"find-up": "^6.2.0",
|
|
@@ -65,6 +57,15 @@
|
|
|
65
57
|
"ora": "^6.0.1",
|
|
66
58
|
"picocolors": "^1.0.0",
|
|
67
59
|
"sinon": "^12.0.1",
|
|
60
|
+
"sinon-chai": "^3.7.0",
|
|
68
61
|
"vite-node": "^0.1.10"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsc",
|
|
65
|
+
"watch": "tsc --watch",
|
|
66
|
+
"lint": "eslint \"{src,test}/**/*.ts\"",
|
|
67
|
+
"release": "bumpp --commit --push --tag && pnpm publish",
|
|
68
|
+
"test": "node bin/vitest.mjs --dev",
|
|
69
|
+
"test:update": "nr test -u"
|
|
69
70
|
}
|
|
70
|
-
}
|
|
71
|
+
}
|