Skip to content

Commit

Permalink
chore: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
olaviolacerda committed Mar 1, 2024
1 parent 77461fd commit 532c38f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 43 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@ name: Test Coveralls

on:
push:
branches: [ "main" ]
branches: ['main']
pull_request:
branches: [ "main" ]
branches: ['main']

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm ci
- run: npm run build --if-present
- run: npm run test:cov

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm ci
- run: npm run build --if-present
- run: npm run test:cov

- name: Coveralls
uses: coverallsapp/[email protected]
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
34 changes: 5 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/src/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage --detectOpenHandles --maxWorkers=1",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/jest/bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json --passWithNoTests",
"test": "jest --config ./test/jest.config.json",
"test:watch": "npm t -- --watch",
"test:cov": "npm t -- --coverage --detectOpenHandles --maxWorkers=1",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/jest/bin/jest --config ./test/jest.config.json --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.config.json --passWithNoTests",
"prepare": "husky install",
"lint:commit": "commitlint",
"typeorm": "typeorm-ts-node-commonjs",
Expand Down Expand Up @@ -80,30 +80,6 @@
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "./",
"modulePaths": [
"<rootDir>"
],
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"src/**/*.(t|j)s",
"!**/main.ts",
"!src/core/entities/**",
"!src/core/modules/**",
"!src/common/**"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
},
"contributors": [
{
"name": "Olavio Lacerda",
Expand Down
2 changes: 1 addition & 1 deletion test/jest-e2e.json → test/jest-e2e.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"moduleFileExtensions": ["js", "json", "ts"],
"rootDir": ".",
"rootDir": "../",
"testEnvironment": "node",
"testRegex": "\\.e2e-spec\\.ts$",
"transform": {
Expand Down
18 changes: 18 additions & 0 deletions test/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"moduleFileExtensions": ["js", "json", "ts"],
"rootDir": "../",
"modulePaths": ["<rootDir>"],
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"src/**/*.(t|j)s",
"!**/main.ts",
"!src/core/entities/**",
"!src/core/modules/**",
"!src/common/**"
],
"coverageDirectory": "./coverage",
"testEnvironment": "node"
}

0 comments on commit 532c38f

Please sign in to comment.