Skip to content

Commit be572b9

Browse files
committed
Update Svelte and testing library for v5 support
1 parent 5f4e11c commit be572b9

File tree

3 files changed

+34
-19
lines changed

3 files changed

+34
-19
lines changed

package-lock.json

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
},
4141
"peerDependencies": {
4242
"konva": "8 - 9",
43-
"svelte": "3 - 4"
43+
"svelte": "5"
4444
},
4545
"devDependencies": {
4646
"@sveltejs/adapter-static": "^3.0.1",
4747
"@sveltejs/kit": "^2.0.4",
4848
"@sveltejs/package": "^2.1.0",
4949
"@tailwindcss/typography": "^0.5.7",
50-
"@testing-library/svelte": "4.0.5",
50+
"@testing-library/svelte": "^5.1.0",
5151
"@types/lodash.clonedeep": "^4.5.7",
5252
"@typescript-eslint/eslint-plugin": "^7.1.0",
5353
"@typescript-eslint/parser": "^7.1.0",
@@ -62,8 +62,8 @@
6262
"plop": "^4.0.1",
6363
"prettier": "^3.1.1",
6464
"prettier-plugin-svelte": "^3.1.2",
65-
"svelte": "5.0.0-next.80",
66-
"svelte-check": "^3.6.7",
65+
"svelte": "5.0.0-next.114",
66+
"svelte-check": "^3.6.9",
6767
"svelte-highlight": "^7.3.0",
6868
"svelte-local-storage-store": "^0.6.4",
6969
"svelte-preprocess": "^5.0.4",

vite.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { sveltekit } from '@sveltejs/kit/vite';
2+
import { svelteTesting } from '@testing-library/svelte/vite';
23
import type { UserConfig } from 'vite';
34
import path from 'path';
45

56
const config: UserConfig = {
6-
plugins: [sveltekit()],
7+
plugins: [sveltekit(), svelteTesting()],
78
optimizeDeps: {
89
include: ['highlight.js', 'highlight.js/lib/core']
910
},
@@ -15,6 +16,10 @@ const config: UserConfig = {
1516
jsdom: {
1617
resources: 'usable'
1718
}
19+
},
20+
// TODO: Alias to enable Svelte 5 support on testing-library, can be removed once stable
21+
alias: {
22+
'@testing-library/svelte': '@testing-library/svelte/svelte5'
1823
}
1924
},
2025
// Workaround as in svelte tests onMount is not called due to being in nodejs environment (SSR) see: https://github.com/testing-library/svelte-testing-library/issues/222#issuecomment-1588987135

0 commit comments

Comments
 (0)