mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Running FE jest tests on github.
This commit is contained in:
parent
a3b16f8a47
commit
e1a6adfde3
2 changed files with 41 additions and 22 deletions
|
|
@ -146,27 +146,7 @@ jobs:
|
|||
- run:
|
||||
name: Stop React App
|
||||
command: pkill -f npm
|
||||
jest-tests:
|
||||
docker:
|
||||
- image: cimg/node:20.13
|
||||
resource_class: medium
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: app-{{ checksum "app/package-lock.json" }}
|
||||
- run:
|
||||
name: Install Dependencies
|
||||
command: cd app && npm install --legacy-peer-deps
|
||||
- save_cache:
|
||||
key: app-{{ checksum "app/package-lock.json" }}
|
||||
paths:
|
||||
- ./app/node_modules
|
||||
- run:
|
||||
name: Run Jest Tests
|
||||
command: cd app && CI=true npm test -- --watchAll=false --coverage --coverageReporters=text --coverageReporters=lcov
|
||||
- store_artifacts:
|
||||
path: app/coverage
|
||||
destination: coverage-report
|
||||
# Jest tests moved to GitHub Actions (.github/workflows/jest-tests.yml)
|
||||
cypress-e2e-tests:
|
||||
docker:
|
||||
- image: cimg/node:20.18-browsers
|
||||
|
|
@ -217,5 +197,5 @@ workflows:
|
|||
wrolpi-app-test:
|
||||
jobs:
|
||||
- react-app-start
|
||||
- jest-tests
|
||||
# jest-tests moved to GitHub Actions
|
||||
- cypress-e2e-tests
|
||||
|
|
|
|||
39
.github/workflows/jest-tests.yml
vendored
Normal file
39
.github/workflows/jest-tests.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: Jest Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, feature/*]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
jest-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: app
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: app/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install --legacy-peer-deps
|
||||
|
||||
- name: Run Jest tests
|
||||
run: CI=true npm test -- --watchAll=false --coverage --coverageReporters=text --coverageReporters=lcov
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-report
|
||||
path: app/coverage
|
||||
retention-days: 30
|
||||
Loading…
Add table
Add a link
Reference in a new issue