Add the testing libraries libraries using the following command:
npm install -D @testing-library/jest-dom @testing-library/svelte jest babel-jest @babel/preset-env jest-environment-jsdom jest-transform-svelte @testing-library/user-event
In the package.json
file ad the following to the scripts
section:
"test": "jest"
Then add the babel.config.js
and jest.config.js
files to the main application directory (the same one where package.json
is)