Skip to content

Commit c81da0b

Browse files
authored
test: add codecov action (#114)
1 parent 0143df8 commit c81da0b

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

.babelrc.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
const useESModules = !!process.env.ESMODULES;
22

3-
if (process.env.NODE_ENV === 'test') {
3+
if (process.env.NODE_ENV === "test") {
44
module.exports = {
5-
presets: [
6-
'@babel/preset-env',
7-
"@babel/preset-react"
8-
],
5+
presets: ["@babel/preset-env", "@babel/preset-react"],
96
plugins: [
107
"@babel/plugin-proposal-class-properties",
11-
"@babel/plugin-transform-runtime",
8+
"@babel/plugin-transform-runtime"
129
]
1310
};
1411
} else {
1512
module.exports = {
16-
"presets": [
13+
presets: [
1714
[
18-
'@babel/preset-env',
15+
"@babel/preset-env",
1916
{
20-
modules: useESModules ? false : 'auto',
17+
modules: useESModules ? false : "auto"
2118
}
2219
],
2320
"@babel/preset-react"
2421
],
25-
"plugins": [
22+
plugins: [
2623
"@babel/plugin-proposal-class-properties",
2724
[
2825
"@babel/plugin-transform-runtime",
2926
{
3027
useESModules,
31-
version: "^7.10.4",
28+
version: "^7.20.7"
3229
}
3330
]
3431
]

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ jobs:
99
- uses: actions/checkout@v4
1010
- uses: actions/setup-node@v4
1111
with:
12-
node-version: '20.x'
12+
node-version: 20
1313
- run: npm install
1414
- run: npm run lint
1515
- run: npm run build
16-
- run: npm test
16+
- run: npm test -- --coverage
17+
- uses: codecov/codecov-action@v4
18+
with:
19+
token: ${{ secrets.CODECOV_TOKEN }}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
"@babel/polyfill": "^7.0.0",
5050
"@babel/preset-env": "^7.1.0",
5151
"@babel/preset-react": "^7.0.0",
52-
"@testing-library/jest-dom": "^5.16.4",
53-
"@testing-library/react": "^13.3.0",
54-
"@testing-library/user-event": "^14.3.0",
52+
"@testing-library/jest-dom": "^6.4.8",
53+
"@testing-library/react": "^16.0.0",
54+
"@testing-library/user-event": "^14.5.2",
5555
"autoprefixer": "^7.1.2",
5656
"babel-core": "^7.0.0-bridge.0",
5757
"babel-jest": "^24.8.0",
@@ -92,7 +92,7 @@
9292
"why-did-you-update": "^0.1.1"
9393
},
9494
"dependencies": {
95-
"@babel/runtime": "^7.10.4",
95+
"@babel/runtime": "^7.20.7",
9696
"classnames": "^2.2.5",
9797
"json2mq": "^0.2.0",
9898
"resize-observer-polyfill": "^1.5.1",

test-setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "@testing-library/jest-dom/extend-expect";
1+
import "@testing-library/jest-dom";
22
import "regenerator-runtime/runtime";
33

44
//Fix for "matchMedia not present, legacy browsers require a polyfill jest" error

0 commit comments

Comments
 (0)