Skip to content

Commit 4869be4

Browse files
committed
chore(tests): update vitest configs and snapshots
1 parent dd8cb84 commit 4869be4

File tree

4 files changed

+19
-23
lines changed

4 files changed

+19
-23
lines changed

src/action-tooltip.snap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ exports[`Components: Tooltip > should render the component 1`] = `
44
<body>
55
<div>
66
<div
7-
class="tooltip animation-null top svelte-ngud14"
8-
style="left: 0px; min-width: 0px; max-width: 200px; text-align: left; top: 0px;"
7+
class="tooltip animation-null top svelte-16lxf1i"
8+
style="left: 0px; min-width: 200px; max-width: 200px; text-align: left; top: 0px;"
99
>
1010
Hello World!
1111

src/tooltip.snap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ exports[`Components: Tooltip > should render the component 1`] = `
88
/>
99
1010
<div
11-
class="tooltip animation-null top svelte-ir0j5h"
12-
style="left: 0px; min-width: 0px; max-width: 200px; text-align: left; top: 0px;"
11+
class="tooltip animation-null top svelte-1xktviv"
12+
style="left: 0px; min-width: 200px; max-width: 200px; text-align: left; top: 0px;"
1313
>
1414
Hello World!
1515

vite.config.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,18 @@ import { defineConfig } from 'vite';
22
import { svelte } from '@sveltejs/vite-plugin-svelte';
33

44
export default defineConfig({
5-
plugins: [
6-
svelte({ emitCss: false })
7-
],
8-
build: {
9-
outDir: 'dist',
10-
lib: {
11-
entry: './src/index.js',
12-
name: 'SvelteTooltips',
13-
fileName: (format) => format === 'umd' ? 'index.js' : 'index.mjs'
14-
},
15-
rollupOptions: {
16-
external: ['svelte'],
17-
output: {
18-
globals: {
19-
svelte: 'svelte',
20-
},
21-
},
22-
},
23-
},
5+
plugins: [svelte({ emitCss: false })],
246
test: {
257
globals: true,
268
environment: 'jsdom',
9+
setupFiles: ['vitest.setup.js'],
10+
testTimeout: 20000,
11+
alias: [
12+
{
13+
find: /^svelte$/,
14+
replacement: 'svelte/internal'
15+
}
16+
],
2717
include: ['./src/**/*.test.js'],
2818
resolveSnapshotPath: (testPath, snapExtension) => testPath.replace(/\.test\.([tj]s?)/, `${snapExtension}.$1`)
2919
}

vitest.setup.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { afterEach, vi } from 'vitest';
2+
import { cleanup } from '@testing-library/svelte';
3+
4+
import '@testing-library/jest-dom/vitest';
5+
6+
afterEach(cleanup);

0 commit comments

Comments
 (0)