Add test step in pr-check action (#2942) Bruception

* Add test step in pr-check action

* Add jest action

* Specify wd

* Remove action

* Remove test

* Add anti-cheat check
This commit is contained in:
Bruce Berrios 2022-05-05 17:06:40 -04:00 committed by GitHub
parent afd288a717
commit 8095dd6bfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 7 deletions

View file

@ -6,10 +6,12 @@ on:
jobs:
build:
permissions:
checks: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
@ -42,9 +44,9 @@ jobs:
working-directory: ./frontend/src/ts/constants
run: mv ./firebase-config-example.ts ./firebase-config-live.ts
# - name: Check Anti-cheat
# if: steps.filter.outputs.anti-cheat == 'true'
# run: exit 1
- name: Check Anti-cheat
if: steps.filter.outputs.anti-cheat == 'true'
run: exit 1
- name: Cache node modules
if: steps.filter.outputs.changes != '[]'
@ -93,6 +95,10 @@ jobs:
if: steps.filter.outputs.ts-be == 'true'
run: npm run pr-check-build-be
- name: Test backend
if: steps.filter.outputs.ts-be == 'true'
run: npm run test-backend
- name: Run webpack
if: steps.filter.outputs.ts-scss-fe == 'true'
run: npm run pr-check-ts

View file

@ -4,4 +4,12 @@ export default {
preset: "@shelf/jest-mongodb",
transform: tsjPreset.transform,
setupFilesAfterEnv: ["<rootDir>/setup-tests.ts"],
coverageThreshold: {
global: {
branches: 0,
functions: 0,
lines: 0,
statements: 0,
},
},
};

View file

@ -8,8 +8,8 @@
"watch": "tsc --build --watch",
"clean": "tsc --build --clean",
"start": "npm run build && node ./build/server.js",
"test": "jest",
"dev": "ts-node-dev ./src/server.ts -- --inspect --transpileOnly"
"test": "jest --verbose --collect-coverage",
"dev": "ts-node-dev server.ts -- --inspect --transpileOnly"
},
"engines": {
"node": "16.13.2",

View file

@ -21,7 +21,8 @@
"pr-check-other-json": "cd frontend && npx gulp pr-check-other-json",
"pr-check-ts": "cd frontend && npx gulp pr-check-ts",
"pr-check-build-be": "cd backend && npm run build",
"docker": "cd backend && docker-compose up"
"docker": "cd backend && docker-compose up",
"test-backend": "cd backend && npm run test"
},
"engines": {
"npm": "8.1.2"