- Adds jest framework with transformers for:
- svelte components (svelte-jester)
* typescript modules (ts-jest)
- svelte components (svelte-jester)
- Adds @testing-library/svelte which provides utility functions for testing svelte components
- Adds @testing-library/jest-dom for extending jest matchers with handy custom DOM matchers
- Adds pouchdb-adapter-memory which should be used in tests (see Adapters section in RxDB docs)
- Adds a snapshot resolver that will place jest snapshots in the top level folder and also keeps the same structure as the tests folder.
jest normally looks for a __tests__ folder in the root of the repository. Snapshots will be placed inside a __snapshots__ folder. I'd also suggest to keep the same folder structure in the tests folder as in the src folder.
Setup code can be placed in the file jest.setup.ts which will be loaded for each test file (reference).