@@ -9,10 +9,10 @@ with any testing framework and runner you're comfortable with.
99
1010## Jest  
1111
12- 1 .  Install Jest and Babel 
12+ 1 .  Install Jest
1313
1414 ``` 
15-  npm install --save-dev jest babel-jest @babel/core @babel/preset-env  
15+  npm install --save-dev jest 
1616 ``` 
1717
18182. Add the following to your `package.json` 
@@ -26,55 +26,46 @@ with any testing framework and runner you're comfortable with.
2626 } 
2727 ``` 
2828
29- 3. Add a `.babelrc` with the following 
30- 
31-  ```json 
32-  { 
33-  "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]] 
34-  } 
35-  ``` 
36- 
37- 4. You'll need to compile the Svelte components before using them in Jest, so 
29+ 3. You'll need to compile the Svelte components before using them in Jest, so 
3830 we need to install 
3931 [jest-transform-svelte](https://github.com/rspieker/jest-transform-svelte) 
4032
4133 ``` 
4234 npm install --save-dev jest-transform-svelte 
4335 ``` 
4436
45- 5 . Add the following Jest configuration to your `package.json`
37+ 4 . Add the following Jest configuration to your `package.json`
4638
4739 ```json 
4840 { 
4941 "jest": { 
5042 "transform": { 
51-  "^.+\\.js$": "babel-jest", 
5243 "^.+\\.svelte$": "jest-transform-svelte" 
5344 }, 
54-  "moduleFileExtensions": ["js", "json", " svelte"] 
45+  "moduleFileExtensions": ["js", "svelte"] 
5546 } 
5647 } 
5748 ``` 
5849
59- 6 . This is optional but it is recommended, you can install
50+ 5 . This is optional but it is recommended, you can install
6051 [jest-dom](https://github.com/testing-library/jest-dom) to add handy 
6152 assertions to Jest 
6253
63-  6 .1 Install jest-dom 
54+  5 .1 Install jest-dom 
6455
6556 ``` 
6657 npm install --save-dev @testing-library/jest-dom 
6758 ``` 
6859
69-  6 .2 Add the following to your Jest configuration in `package.json` 
60+  5 .2 Add the following to your Jest configuration in `package.json` 
7061
7162 ```json 
7263 { 
7364 "setupFilesAfterEnv": ["@testing-library/jest-dom/extend-expect"] 
7465 } 
7566 ``` 
7667
77- 7 . Create your component + test file (checkout the rest of the docs to see how)
68+ 6 . Create your component + test file (checkout the rest of the docs to see how)
7869 and run it 
7970
8071 ``` 
0 commit comments