Skip to content

Commit

Permalink
Vitest improvements: vitest-ui, watch mode for deps, debug config (mi…
Browse files Browse the repository at this point in the history
…crosoft#2791)

Add vitest ui package and `test:ui` command to popup the vitest UI
https://vitest.dev/guide/ui

Import the common vitest config from the workspace so each package
doesn't need to define all of it.
Added `watchExclude: []` to the common config to preven vitest from
excluding dist and node_modules folder which is required so it can auto
rerun the test on when a dependency (monorepo dep) rebuilds

Added debug config to debug the current test. As the vitest extensions
is quite unreliable this should help
  • Loading branch information
timotheeguerin authored Jan 22, 2024
1 parent 62e6b01 commit 55ea442
Show file tree
Hide file tree
Showing 115 changed files with 607 additions and 369 deletions.
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
"order": 999
}
},
{
"type": "node",
"request": "launch",
"name": "Debug Current Test File",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${workspaceRoot}/packages/compiler/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}"],
"smartStep": true
},
{
"name": "Attach to Language Server",
"type": "node",
Expand Down
10 changes: 10 additions & 0 deletions common/changes/@typespec/bundler/vitest-ui_2024-01-11-21-20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/bundler",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/bundler"
}
10 changes: 10 additions & 0 deletions common/changes/@typespec/compiler/vitest-ui_2024-01-11-21-20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/compiler",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/compiler"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/eslint-plugin",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/eslint-plugin"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/html-program-viewer",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/html-program-viewer"
}
10 changes: 10 additions & 0 deletions common/changes/@typespec/http/vitest-ui_2024-01-11-21-20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/http",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/http"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/internal-build-utils",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/internal-build-utils"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/json-schema",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/json-schema"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/library-linter",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/library-linter"
}
10 changes: 10 additions & 0 deletions common/changes/@typespec/openapi/vitest-ui_2024-01-11-21-20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/openapi",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/openapi"
}
10 changes: 10 additions & 0 deletions common/changes/@typespec/openapi3/vitest-ui_2024-01-11-21-20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/openapi3",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/openapi3"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/playground",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/playground"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/prettier-plugin-typespec",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/prettier-plugin-typespec"
}
10 changes: 10 additions & 0 deletions common/changes/@typespec/protobuf/vitest-ui_2024-01-11-21-20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/protobuf",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/protobuf"
}
10 changes: 10 additions & 0 deletions common/changes/@typespec/rest/vitest-ui_2024-01-11-21-20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/rest",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/rest"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/versioning",
"comment": "",
"type": "none"
}
],
"packageName": "@typespec/versioning"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "tmlanguage-generator",
"comment": "",
"type": "none"
}
],
"packageName": "tmlanguage-generator"
}
10 changes: 10 additions & 0 deletions common/changes/typespec-vscode/vitest-ui_2024-01-11-21-20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "typespec-vscode",
"comment": "",
"type": "none"
}
],
"packageName": "typespec-vscode"
}
Loading

0 comments on commit 55ea442

Please sign in to comment.