vitest
Advanced tools
Comparing version 0.0.30 to 0.0.31
@@ -8,1 +8,6 @@ import { run } from '../run'; | ||
await run(options); | ||
const timer = setTimeout(() => { | ||
// TODO: warn user and maybe error out | ||
process.exit(); | ||
}, 500); | ||
timer.unref(); |
@@ -188,3 +188,3 @@ import fg from 'fast-glob'; | ||
if (config.watch) | ||
startWatcher(ctx); | ||
await startWatcher(ctx); | ||
} | ||
@@ -200,2 +200,3 @@ export async function startWatcher(ctx) { | ||
server.watcher.on('change', async (id) => { | ||
id = normalizePath(id); | ||
getDependencyTests(id, ctx, changedTests, seen); | ||
@@ -224,3 +225,11 @@ seen.forEach(i => moduleCache.delete(i)); | ||
}); | ||
// add an empty promise so it never resolves | ||
await new Promise(() => { }); | ||
} | ||
function normalizePath(path) { | ||
const normalized = path.replace(/\\/g, '/'); | ||
if (normalized.startsWith('/')) | ||
return normalized; | ||
return `/${normalized}`; | ||
} | ||
function getDependencyTests(id, ctx, set = new Set(), seen = new Set()) { | ||
@@ -227,0 +236,0 @@ if (seen.has(id) || set.has(id)) |
{ | ||
"name": "vitest", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"description": "A blazing fast unit test framework powered by Vite", | ||
@@ -50,2 +50,3 @@ "keywords": [ | ||
"test:vue": "node bin/vitest.mjs --dev -r test/vue", | ||
"test:react": "node bin/vitest.mjs --dev -r test/react", | ||
"watch": "tsc -p src/tsconfig.json --watch" | ||
@@ -77,3 +78,3 @@ }, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^0.12.1", | ||
"@antfu/eslint-config": "^0.12.2", | ||
"@antfu/ni": "^0.11.0", | ||
@@ -84,8 +85,7 @@ "@types/chai-subset": "^1.3.3", | ||
"@types/listr": "^0.14.4", | ||
"@types/node": "^16.11.11", | ||
"@types/node": "^16.11.12", | ||
"@types/sade": "^1.7.3", | ||
"@types/sinon": "^10.0.6", | ||
"@vitejs/plugin-vue": "^1.10.1", | ||
"bumpp": "^7.1.1", | ||
"eslint": "^8.4.0", | ||
"eslint": "^8.4.1", | ||
"esno": "^0.12.1", | ||
@@ -95,5 +95,4 @@ "npm-run-all": "^4.1.5", | ||
"typescript": "^4.5.2", | ||
"vite": "^2.7.0", | ||
"vue": "^3.2.24" | ||
"vite": "^2.7.0" | ||
} | ||
} |
@@ -49,2 +49,8 @@ # vitest | ||
## Examples | ||
- [Unit Testing](./test/core) | ||
- [Vue Component Testing](./test/vue) | ||
- [React Component Testing](./test/react) | ||
## Configuration | ||
@@ -51,0 +57,0 @@ |
79109
16
1999