All Projects → rossyman → svelte-add-jest

rossyman / svelte-add-jest

Licence: MIT license
SvelteKit adder for Jest unit testing

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to svelte-add-jest

sveltekit-electron
Minimal Sveltekit + Electron starter template.
Stars: ✭ 146 (+370.97%)
Mutual labels:  sveltekit
svelte-starter-kit
Svelte with brilliant bells and useful whistles
Stars: ✭ 384 (+1138.71%)
Mutual labels:  sveltekit
Beatbump
Alternative YouTube Music frontend built with Svelte/SvelteKit 🎧
Stars: ✭ 77 (+148.39%)
Mutual labels:  sveltekit
webstone
Start your next full-stack application with Webstone and configure it as you go.
Stars: ✭ 71 (+129.03%)
Mutual labels:  sveltekit
website
Gitpod website and documentation
Stars: ✭ 233 (+651.61%)
Mutual labels:  sveltekit
programmingtil-svelte
No description or website provided.
Stars: ✭ 59 (+90.32%)
Mutual labels:  sveltekit
generator-jhipster-svelte
Generate Svelte powered JHipster web applications
Stars: ✭ 44 (+41.94%)
Mutual labels:  sveltekit
svelte-slate
slate svelte view layer
Stars: ✭ 43 (+38.71%)
Mutual labels:  sveltekit
hue.tools
Simple toolbox for working with colors. Color mixing, blending, conversion, modification, detailed information, etc.
Stars: ✭ 331 (+967.74%)
Mutual labels:  sveltekit
markushatvan.com
Personal website and blog written from scratch with SvelteKit and TailwindCSS.
Stars: ✭ 82 (+164.52%)
Mutual labels:  sveltekit
sveltekit-seo
Demo site for SvelteKit SEO showing how to set up meta tags in a SvelteKit blog site.
Stars: ✭ 28 (-9.68%)
Mutual labels:  sveltekit
svelte-toy
A toy for svelte data stores
Stars: ✭ 73 (+135.48%)
Mutual labels:  sveltekit
awesome-svelte-kit
Curated resources on building sites with SvelteKit - A server-less-first answer to "the Next.js experience" by the Svelte community
Stars: ✭ 55 (+77.42%)
Mutual labels:  sveltekit
website
🏡 My personal website! Now built with Svelte...
Stars: ✭ 18 (-41.94%)
Mutual labels:  sveltekit
matfantinel.github.io
Personal website made with SvelteKit and hosted on GitHub Pages
Stars: ✭ 80 (+158.06%)
Mutual labels:  sveltekit
svelte-parallax
a (small) spring-based parallax component library for Svelte
Stars: ✭ 87 (+180.65%)
Mutual labels:  sveltekit
focus-svelte
focus lock for svelte
Stars: ✭ 18 (-41.94%)
Mutual labels:  sveltekit
tailwindcss
Add Tailwind CSS to your Svelte project
Stars: ✭ 583 (+1780.65%)
Mutual labels:  sveltekit
barnsworthburning
A commonplace book.
Stars: ✭ 20 (-35.48%)
Mutual labels:  sveltekit
turbosvelte
A SvelteKit monorepo starter project powered by Turborepo!
Stars: ✭ 47 (+51.61%)
Mutual labels:  sveltekit

🧪 Add Jest to Sveltekit

What is this?

This is an experimental command to run to add Jest to your SvelteKit project.

🛠 Usage

You must start with a fresh copy of the official SvelteKit template, which is currently created by running this command:

npm create svelte@latest <app-name>

Once that is set up, run this command in your project directory to set up Jest:

❗️ When running with TypeScript support enabled, remove comments within tsconfig.json or the adder will fail. This is a known limitation of Preset, as it relies upon JSON.parse.

npx apply rossyman/svelte-add-jest # --no-ssh

After the preset runs,

  • npm install, pnpm i, or yarn to update dependencies.

  • You can apply another Svelte Adder to your project for more functionality.

⚙️ Options

Description Flag Negated Default
Interactive Mode --interaction --no-interaction True
Jest DOM Support --jest-dom --no-jest-dom True
Typescript Support --ts --no-ts False
JSDOM Jest Env by Default --jsdom --jsdom True
Generate Example --examples --no-examples True

📑 Relevant Documentation

Routed Tests

If you run into an issue when writing tests for routed svelte components or files (Reference error: describe is not defined), this is a known issue. To fix it, you must modify your svelte.config.js (Specifically the routes property) with the following modification:

kit: {
    // Prior svelte configuration goes here...
    routes: filepath => {
        return ![
            // Exclude spec files
            /\.spec\.(ts|js)$/,
            // Original routes
            /(?:(?:^_|\/_)|(?:^\.|\/\.)(?!well-known))/,
        ].some(regex => regex.test(filepath))
    },
}

The reason we cannot perform this change directly for you, is due to a limitation within Preset.

😵 Help! I have a question

Create an issue and we'll try to help.

😡 Fix! There is something that needs improvement

Create an issue or pull request and we'll try to fix.

These are new tools, so there are likely to be problems in this project. Thank you for bringing them to our attention or fixing them for us.

📄 License

MIT


Repository preview image generated with GitHub Social Preview

This README was generated with ❤️ by readme-md-generator

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].