Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
],
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
},
{
"name": "Run Extension Imba Sample",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}/samples/imba"
],
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
},
{
"name": "Run Extension No Config Sample",
"type": "extensionHost",
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"source.organizeImports": "never"
},

"vitest.workspaceConfig": "./vitest.workspace.vscode.ts",
"testing.openTesting": "neverOpen",

// Enable eslint for all supported languages
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ These options are resolved relative to the [workspace file](https://code.visuals
- `vitest.rootConfig`: The path to your root config file. If you have several Vitest configs, consider using a [Vitest workspace](https://vitest.dev/guide/workspace).
- `vitest.workspaceConfig`: The path to the [Vitest workspace](https://vitest.dev/guide/workspace) config file. You can only have a single workspace config per VSCode workspace.
- `vitest.configSearchPatternExclude`: [Glob pattern](https://code.visualstudio.com/docs/editor/glob-patterns) that should be ignored when this extension looks for config files. Note that this is applied to _config_ files, not test files inside configs. Default: `{**/node_modules/**,**/.*/**,*.d.ts}`. If the extension cannot find Vitest, please open an issue.
- `vitest.shellType`: The method the extension uses to spawn a long-running Vitest process. This is particularly useful if you are using a custom shell script to set up the environment. When using the `terminal` shell type, the websocket connection will be established. Can either be `terminal` or `child_process`. Default: `child process`.
- `vitest.nodeExecutable`: The path to the Node.js executable. If not assigned, tries to find Node.js path via a PATH variable or a `which` command. This is applied only when `vitest.shellType` is `child_process` (the default).
- `vitest.nodeExecArgs`: The arguments to pass to the Node.js executable. This is applied only when `vitest.shellType` is `child_process` (the default).
- `vitest.terminalShellPath`: The path to the shell executable. This is applied only when `vitest.shellType` is `terminal`.
- `vitest.terminalShellArgs`: The arguments to pass to the shell executable. This is applied only when `vitest.shellType` is `terminal`.
- `vitest.shellType`: The method the extension uses to spawn a long-running Vitest process. This is particularly useful if you are using a custom shell script to set up the environment. When using the `terminal` shell type, the websocket connection will be established. Can either be `terminal` or `child_process`. Default: `terminal`.
- `vitest.nodeExecutable`: The path to the Node.js executable. If not assigned, tries to find Node.js path via a PATH variable or a `which` command. This is applied only when `vitest.shellType` is `child_process`.
- `vitest.nodeExecArgs`: The arguments to pass to the Node.js executable. This is applied only when `vitest.shellType` is `child_process`.
- `vitest.terminalShellPath`: The path to the shell executable. This is applied only when `vitest.shellType` is `terminal` (the default).
- `vitest.terminalShellArgs`: The arguments to pass to the shell executable. This is applied only when `vitest.shellType` is `terminal` (the default).
- `vitest.debuggerPort`: Port that the debugger will be attached to. By default uses 9229 or tries to find a free port if it's not available.
- `vitest.debuggerAddress`: TCP/IP address of process to be debugged. Default: localhost
- `vitest.cliArguments`: Additional arguments to pass to the Vitest CLI. Note that some arguments will be ignored: `watch`, `reporter`, `api`, and `ui`. Example: `--mode=staging`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"terminal",
"child_process"
],
"default": "child_process",
"default": "terminal",
"scope": "resource"
},
"vitest.terminalShellPath": {
Expand Down
1 change: 0 additions & 1 deletion samples/vite-6/.skip/vitest.config.ts

This file was deleted.

9 changes: 0 additions & 9 deletions samples/vite-6/.vscode/settings.json

This file was deleted.

15 changes: 0 additions & 15 deletions samples/vite-6/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions samples/vite-6/test/fail.test.ts

This file was deleted.

9 changes: 0 additions & 9 deletions samples/vite-6/test/mix.test.ts

This file was deleted.

5 changes: 0 additions & 5 deletions samples/vite-6/test/pass.test.ts

This file was deleted.

3 changes: 0 additions & 3 deletions samples/vite-6/vite.config.ts

This file was deleted.

4 changes: 0 additions & 4 deletions samples/vite-6/vitest.config.d.ts

This file was deleted.

15 changes: 0 additions & 15 deletions samples/vite-6/vitest.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function getConfig(workspaceFolder?: WorkspaceFolder) {

const terminalShellArgs = get<string[] | undefined>('terminalShellArgs')
const terminalShellPath = get<string | undefined>('terminalShellPath')
const shellType = get<'child_process' | 'terminal'>('shellType', 'child_process')!
const shellType = get<'child_process' | 'terminal'>('shellType', 'terminal')!
const nodeExecArgs = get<string[] | undefined>('nodeExecArgs')

const experimentalStaticAstCollect = get<boolean>('experimentalStaticAstCollect', false)!
Expand Down
46 changes: 0 additions & 46 deletions test/e2e/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,52 +67,6 @@ test('basic', async ({ launch }) => {
})
})

test('vite-6', async ({ launch }) => {
const { page, tester } = await launch({
workspacePath: './samples/vite-6',
})

await expect(page.getByText('No test results yet.')).toBeVisible()

await tester.tree.expand('test')
await tester.tree.expand('test/pass.test.ts')
await tester.tree.expand('test/fail.test.ts')
await tester.tree.expand('test/mix.test.ts')

const allPassTests = tester.tree.getFileItem('pass.test.ts')
await expect(allPassTests).toHaveTests({
'all-pass': 'waiting',
})

const allFailTests = tester.tree.getFileItem('fail.test.ts')
await expect(allFailTests).toHaveTests({
'all-fail': 'waiting',
})

const mixedTests = tester.tree.getFileItem('mix.test.ts')
await expect(mixedTests).toHaveTests({
'mix-pass': 'waiting',
'mix-fail': 'waiting',
})

await tester.runAllTests()

await expect(tester.tree.getResultsLocator()).toHaveText('2/4')
await expect(allPassTests).toHaveState('passed')
await expect(allPassTests).toHaveTests({
'all-pass': 'passed',
})
await expect(allFailTests).toHaveState('failed')
await expect(allFailTests).toHaveTests({
'all-fail': 'failed',
})
await expect(mixedTests).toHaveState('failed')
await expect(mixedTests).toHaveTests({
'mix-pass': 'passed',
'mix-fail': 'failed',
})
})

test('workspaces', async ({ launch }) => {
const { tester } = await launch({
workspacePath: './samples/monorepo-vitest-workspace',
Expand Down
Loading