a template starter repo for sveltekit projects
0

Configure Feed

Select the types of activity you want to include in your feed.

suede / vite.config.ts
1.8 kB 71 lines
1/// <reference types="vitest/config" /> 2import { defineConfig } from 'vitest/config'; 3import { playwright } from '@vitest/browser-playwright'; 4import { sveltekit } from '@sveltejs/kit/vite'; 5import path from 'node:path'; 6import { fileURLToPath } from 'node:url'; 7import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'; 8const dirname = 9 typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); 10 11// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon 12export default defineConfig({ 13 plugins: [sveltekit()], 14 test: { 15 expect: { 16 requireAssertions: true 17 }, 18 projects: [ 19 { 20 extends: './vite.config.ts', 21 test: { 22 name: 'client', 23 browser: { 24 enabled: true, 25 provider: playwright(), 26 instances: [ 27 { 28 browser: 'chromium', 29 headless: true 30 } 31 ] 32 }, 33 include: ['src/**/*.svelte.{test,spec}.{js,ts}'], 34 exclude: ['src/lib/server/**'] 35 } 36 }, 37 { 38 extends: './vite.config.ts', 39 test: { 40 name: 'server', 41 environment: 'node', 42 include: ['src/**/*.{test,spec}.{js,ts}'], 43 exclude: ['src/**/*.svelte.{test,spec}.{js,ts}'] 44 } 45 }, 46 { 47 extends: true, 48 plugins: [ 49 // The plugin will run tests for the stories defined in your Storybook config 50 // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest 51 storybookTest({ 52 configDir: path.join(dirname, '.storybook') 53 }) 54 ], 55 test: { 56 name: 'storybook', 57 browser: { 58 enabled: true, 59 headless: true, 60 provider: playwright({}), 61 instances: [ 62 { 63 browser: 'chromium' 64 } 65 ] 66 } 67 } 68 } 69 ] 70 } 71});