mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
test: scaffold component testing with Vitest
This commit is contained in:
parent
89387004a3
commit
8b477b12f9
9 changed files with 2324 additions and 39 deletions
22
vite.config.ts
Normal file
22
vite.config.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
/// <reference types="vitest" />
|
||||
import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||||
import { optimizeImports } from "carbon-preprocess-svelte";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
export default defineConfig({
|
||||
root: "./tests",
|
||||
plugins: [
|
||||
svelte({
|
||||
preprocess: [vitePreprocess(), optimizeImports()],
|
||||
}),
|
||||
],
|
||||
optimizeDeps: {
|
||||
exclude: ["carbon-components-svelte", "carbon-icons-svelte"],
|
||||
},
|
||||
resolve: process.env.VITEST ? { conditions: ["browser"] } : undefined,
|
||||
test: {
|
||||
globals: true,
|
||||
environment: "jsdom",
|
||||
setupFiles: ["./tests/setup-tests.ts"],
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue