-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing
root
property to vitest (#677)
- Loading branch information
Showing
11 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/knip/fixtures/plugins/vitest4/node_modules/vitest/config.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/knip/fixtures/plugins/vitest4/node_modules/vitest/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "@fixtures/vitest4", | ||
"devDependencies": { | ||
"vitest": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { expect, test } from 'vitest'; | ||
|
||
test('Unit A', () => { | ||
expect(true).toBe(!false); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { expect, test } from 'vitest'; | ||
|
||
test('Unit A', () => { | ||
expect(true).toBe(!false); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'vitest/config'; | ||
|
||
export default defineConfig({ | ||
test: { | ||
root: 'tests', | ||
include: ['*.test.ts'], | ||
setupFiles: ['./setup.ts'], | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { test } from 'bun:test'; | ||
import assert from 'node:assert/strict'; | ||
import { main } from '../../src/index.js'; | ||
import { join, resolve } from '../../src/util/path.js'; | ||
import baseArguments from '../helpers/baseArguments.js'; | ||
import baseCounters from '../helpers/baseCounters.js'; | ||
|
||
const cwd = resolve('fixtures/plugins/vitest4'); | ||
|
||
test('Find dependencies with Vitest plugin (4)', async () => { | ||
const { issues, counters } = await main({ | ||
...baseArguments, | ||
cwd, | ||
}); | ||
|
||
assert(issues.files.has(join(cwd, 'src/unused.test.ts'))); | ||
|
||
assert.deepEqual(counters, { | ||
...baseCounters, | ||
files: 1, | ||
processed: 4, | ||
total: 4, | ||
}); | ||
}); |