mirror of
https://github.com/sveltejs/svelte.git
synced 2024-11-22 03:47:27 +01:00
3df9d8466f
- shard runtime tests for better use of Vite's test parallelization - merge custom element and other browser tests to run in one test suite and use esbuild in it - on some setups only generate code output when test fails
29 lines
626 B
JavaScript
29 lines
626 B
JavaScript
import { configDefaults, defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
{
|
|
name: 'resolve-svelte',
|
|
resolveId(id) {
|
|
if (id === 'svelte/compiler') {
|
|
return `${__dirname}/src/compiler/index.js`;
|
|
}
|
|
|
|
if (id === 'svelte') {
|
|
return `${__dirname}/src/runtime/index.js`;
|
|
}
|
|
|
|
if (id.startsWith('svelte/')) {
|
|
return id.replace(/^svelte(.*)\/?$/, `${__dirname}/src/runtime/$1/index.js`);
|
|
}
|
|
}
|
|
}
|
|
],
|
|
test: {
|
|
dir: 'test',
|
|
reporters: ['dot'],
|
|
exclude: [...configDefaults.exclude, '**/samples/**'],
|
|
globalSetup: './test/vitest-global-setup.js'
|
|
}
|
|
});
|