Jest custom transformer for transforming Svelte.
This package is inspired by svelte-jester
,
but this package is opinionated and simple: It requires svelte-preprocess
to do transformation and it doesn't provide any configurations.
If you need to customize something,
use svelte-jester
instead.
svelte.config.js
) is required.child_process
to transform Svelte code.npm i @gplane/svelte-jest
Update your Jest configuration like this:
"transform": {
"^.+\\.svelte$": "@gplane/svelte-jest"
}
If you're using TypeScript or other Jest transformers, please also add them properly:
"transform": {
"^.+\\.svelte$": "@gplane/svelte-jest",
"^.+\\.tsx?$": "ts-jest"
}
MIT License
2020-present (c) Pig Fang