Testing .svelte.ts/js files #10647
Unanswered
MentalGear
asked this question in
Q&A
Replies: 1 comment
-
It is working for me just fine with And if you want to use runes in your test files, you just need to use valid filename convention - end filename with I also included this file ending in vite config in export default defineConfig({
plugins: [
nodePolyfills({
include: ['path', 'fs'],
}),
vitestBrowserConditionPlugin, sveltekit()],
test: {
globals: true,
environment: 'jsdom',
include: ['tests/**/*.test.{js,svelte.js}'], // 👈 `svelte.js` added here
alias: {
"@testing-library/svelte": "@testing-library/svelte/svelte5",
},
// extend jsdom matchers
setupFiles: ['./tests/_setup.js']
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using a $state in a class like this, how can the file be made testable using frameworks like vitest ?
Beta Was this translation helpful? Give feedback.
All reactions