add vitest demo

This commit is contained in:
kbwo 2024-07-15 19:07:44 +09:00
parent 0ae8988cc5
commit 3f88f9b1b6
8 changed files with 1634 additions and 4 deletions

View file

@ -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
View file

@ -0,0 +1,2 @@
node_modules
.yarn

View file

@ -0,0 +1 @@
nodeLinker: node-modules

View 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);
});
});

View 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"
}
}

View 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

File diff suppressed because it is too large Load diff