-
Notifications
You must be signed in to change notification settings - Fork 91
36 lines (29 loc) · 898 Bytes
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Run Tests
on:
pull_request:
push:
branches: [main]
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies
run: |
npm install
npm install --save-dev jest babel-jest @babel/preset-env @babel/preset-react
npm install --save-dev @testing-library/react @testing-library/jest-dom
npm install --save-dev @babel/preset-typescript
- name: Configure Jest with Babel
run: |
echo '{"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"]}' > babel.config.json
- name: Run tests
run: npm test