[EngSys] add VS Code vitest settings for core packages (#31583)

The vtest VS code extension
(https://marketplace.visualstudio.com/items?itemName=vitest.explorer)
works well for unit tests but not so for other packages because most of
them does not run properly without dev-tool.

Deleting vitest config files for healthinsights-radiologyinsights-rest
because it hasn't been migrated to use vitest yet.
This commit is contained in:
Jeremy Meng 2024-10-30 15:06:42 -07:00 коммит произвёл GitHub
Родитель dc6da5a3a2
Коммит ad4d271667
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 9 добавлений и 65 удалений

3
.gitignore поставляемый
Просмотреть файл

@ -192,3 +192,6 @@ sdk/template/template-dpg/src/src
# sshkey
sdk/**/sshKey
sdk/**/sshKey.pub
# vitest results
.vite/vitest/results.json

6
.vscode/settings.json поставляемый
Просмотреть файл

@ -36,5 +36,9 @@
"**/*.d.ts": true,
"**/test-browser/*": true
},
"typescript.tsdk": "./sdk/core/core-rest-pipeline/node_modules/typescript/lib"
"typescript.tsdk": "./sdk/core/core-rest-pipeline/node_modules/typescript/lib",
"vitest.vitestPackagePath": "common/tools/dev-tool/node_modules/vitest/package.json",
"vitest.experimentalStaticAstCollect": true,
"vitest.configSearchPatternExclude": "{**/node_modules/**,**/.*/**,**/*.d.ts,eng/**,samples/**}",
"vitest.nodeEnv": {}
}

Просмотреть файл

@ -1,33 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { defineConfig } from "vitest/config";
export default defineConfig({
define: {
"process.env": process.env,
},
test: {
reporters: ["basic", "junit"],
outputFile: {
junit: "test-results.browser.xml",
},
browser: {
enabled: true,
headless: true,
name: "chromium",
provider: "playwright",
},
fakeTimers: {
toFake: ["setTimeout", "Date"],
},
watch: false,
include: ["dist-test/browser/**/*.spec.js"],
coverage: {
include: ["dist-test/browser/**/*.spec.js"],
provider: "istanbul",
reporter: ["text", "json", "html"],
reportsDirectory: "coverage-browser",
},
},
});

Просмотреть файл

@ -1,31 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
reporters: ["basic", "junit"],
outputFile: {
junit: "test-results.browser.xml",
},
fakeTimers: {
toFake: ["setTimeout", "Date"],
},
watch: false,
include: ["test/**/*.spec.ts"],
exclude: ["test/**/browser/*.spec.ts"],
coverage: {
include: ["src/**/*.ts"],
exclude: [
"src/**/*-browser.mts",
"src/**/*-react-native.mts",
"vitest*.config.ts",
"samples-dev/**/*.ts",
],
provider: "istanbul",
reporter: ["text", "json", "html"],
reportsDirectory: "coverage",
},
},
});

1
vitest.workspace.ts Normal file
Просмотреть файл

@ -0,0 +1 @@
export default ["sdk/core/*/vitest.config.ts"];