vitest 0.0.4 → 0.0.6

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/bin/vitest.mjs CHANGED
@@ -5,6 +5,7 @@ import { fileURLToPath } from 'url'
5
5
  import { resolve, dirname } from 'path'
6
6
  import { run } from 'vite-node'
7
7
  import minimist from 'minimist'
8
+ import { findUp } from 'find-up'
8
9
 
9
10
  const argv = minimist(process.argv.slice(2), {
10
11
  alias: {
@@ -17,12 +18,14 @@ const argv = minimist(process.argv.slice(2), {
17
18
  const __dirname = dirname(fileURLToPath(import.meta.url))
18
19
  const root = resolve(argv.root || process.cwd())
19
20
 
21
+ const configPath = argv.config ? resolve(root, argv.config) : await findUp(['vitest.config.ts', 'vitest.config.js', 'vitest.config.mjs', 'vite.config.ts', 'vite.config.js', 'vite.config.mjs'], { cwd: root })
22
+
20
23
  await run({
21
24
  root,
22
25
  files: [
23
26
  resolve(__dirname, argv.dev ? '../src/cli.ts' : '../dist/cli.js'),
24
27
  ],
25
- config: resolve(root, argv.config || 'vitest.config.ts'),
28
+ config: configPath,
26
29
  defaultConfig: {
27
30
  optimizeDeps: {
28
31
  exclude: [
package/dist/run.js CHANGED
@@ -76,7 +76,7 @@ export async function run(options = {}) {
76
76
  const files = await fg(options.includes || ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], {
77
77
  absolute: true,
78
78
  cwd: options.rootDir,
79
- ignore: options.excludes || ['/node_modules/', '/dist/'],
79
+ ignore: options.excludes || ['**/node_modules/**', '**/dist/**'],
80
80
  });
81
81
  if (!files.length) {
82
82
  console.error('No test files found');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "keywords": [],
@@ -53,10 +53,11 @@
53
53
  "vite": "^2.6.14"
54
54
  },
55
55
  "dependencies": {
56
- "@types/chai": "^4.2.22",
57
56
  "@jest/test-result": "^27.4.2",
57
+ "@types/chai": "^4.2.22",
58
58
  "chai": "^4.3.4",
59
59
  "fast-glob": "^3.2.7",
60
+ "find-up": "^6.2.0",
60
61
  "jest-snapshot": "^27.4.2",
61
62
  "jest-util": "^27.4.2",
62
63
  "minimist": "^1.2.5",