Skip to content

Commit 42f61a4

Browse files
committed
Jest tests: Add Babel support.
- Can now be run simply with $ yarn run jest
1 parent a9f2283 commit 42f61a4

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

babel.config.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env", {
5+
"targets": {"node": "current"}
6+
}
7+
]
8+
]
9+
}

package.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,17 @@
7575
"node"
7676
],
7777
"testMatch": [
78-
"**/?(*.)test.?js"
78+
"**/?(*.)test.?js"
7979
],
8080
"testPathIgnorePatterns": [
81-
"/node_modules/", "/cypress/"
81+
"/node_modules/",
82+
"/cypress/"
83+
],
84+
"transform": {
85+
"^.+\\.m?js$": "babel-jest"
86+
},
87+
"transformIgnorePatterns": [
88+
"\\.pnp\\.[^\\/]+$"
8289
]
8390
}
8491
}

0 commit comments

Comments
 (0)