mirror of
https://github.com/kbwo/testing-language-server.git
synced 2025-07-24 11:23:42 +00:00
add vitest demo
This commit is contained in:
parent
0ae8988cc5
commit
3f88f9b1b6
8 changed files with 1634 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
|||
"testing": {
|
||||
"command": "testing-language-server",
|
||||
"trace.server": "verbose",
|
||||
"filetypes": ["rust", "javascript", "go"],
|
||||
"filetypes": ["rust", "javascript", "go", "typescript"],
|
||||
"initializationOptions": {
|
||||
"adapterCommand": {
|
||||
"rust": [
|
||||
|
@ -14,12 +14,23 @@
|
|||
"exclude_patterns": ["/**/target/**"]
|
||||
}
|
||||
],
|
||||
"javascript": [
|
||||
"jest": [
|
||||
{
|
||||
"path": "testing-ls-adapter",
|
||||
"extra_args": ["--test-kind=jest"],
|
||||
"include_patterns": ["/**/*.js"],
|
||||
"exclude_patterns": ["/**/node_modules/**/*"]
|
||||
"include_patterns": ["/jest/*.js"],
|
||||
"exclude_patterns": ["/jest/**/node_modules/**/*"]
|
||||
}
|
||||
],
|
||||
"vitest": [
|
||||
{
|
||||
"path": "testing-ls-adapter",
|
||||
"extra_args": ["--test-kind=vitest"],
|
||||
"include_patterns": [
|
||||
"/vitest/*.test.ts",
|
||||
"/vitest/config/**/*.test.ts"
|
||||
],
|
||||
"exclude_patterns": ["/vitest/**/node_modules/**/*"]
|
||||
}
|
||||
],
|
||||
"go": [
|
||||
|
|
Binary file not shown.
2
test_proj/vitest/.gitignore
vendored
Normal file
2
test_proj/vitest/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
node_modules
|
||||
.yarn
|
1
test_proj/vitest/.yarnrc.yml
Normal file
1
test_proj/vitest/.yarnrc.yml
Normal file
|
@ -0,0 +1 @@
|
|||
nodeLinker: node-modules
|
12
test_proj/vitest/basic.test.ts
Normal file
12
test_proj/vitest/basic.test.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import assert from "assert";
|
||||
import { describe, test } from "vitest";
|
||||
|
||||
describe("describe text", () => {
|
||||
test("pass", async () => {
|
||||
assert(false);
|
||||
});
|
||||
|
||||
test("fail", async () => {
|
||||
assert(false);
|
||||
});
|
||||
});
|
16
test_proj/vitest/package.json
Normal file
16
test_proj/vitest/package.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "spec",
|
||||
"version": "0.0.1",
|
||||
"description": "neotest-vitest spec",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ts-node": "^10.8.2",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.0.3",
|
||||
"vite": "^3.0.9",
|
||||
"vitest": "^0.22.1"
|
||||
}
|
||||
}
|
13
test_proj/vitest/vite.config.ts
Normal file
13
test_proj/vitest/vite.config.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
/// <reference types="vitest" />
|
||||
|
||||
// Configure Vitest (https://vitest.dev/config/)
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
/* for example, use global to avoid globals imports (describe, test, expect): */
|
||||
// globals: true,
|
||||
},
|
||||
})
|
||||
|
1575
test_proj/vitest/yarn.lock
Normal file
1575
test_proj/vitest/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue