F
F
Floydreme2021-12-30 00:55:35
GitHub
Floydreme, 2021-12-30 00:55:35

Why are tests not passing in Github Actions?

Hello! I wrote my microservice in TS and created unit tests for it. Locally they pass, but on GitHub Actions everything falls with the error below. How can this be fixed? Thank you.
61ccd88031b1d759600893.png

node.js.yml

name: Node.js CI

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

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x, 14.x, 16.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/[email protected]
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/[email protected]
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - run: npm ci
    - run: npm run build --if-present
    - run: npm test


tsconfig.json
{
    "compilerOptions": {
        "module": "CommonJS",
        "strict": true,
        "declaration": true,
        "removeComments": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "allowSyntheticDefaultImports": true,
        "target": "es2017",
        "sourceMap": true,
        "outDir": "./dist",
        "baseUrl": "./",
        "types": ["node"],
        "moduleResolution": "node",
        "incremental": true,
        "skipLibCheck": true,
        "strictNullChecks": false,
        "noImplicitAny": false,
        "strictBindCallApply": false,
        "forceConsistentCasingInFileNames": false,
        "noFallthroughCasesInSwitch": false
    },
    "include": [
        "src/**/*.ts",
        "test/**/*.ts"
    ],
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Floydreme, 2021-12-30
@FloydReme

Understood. It was necessary to add prisma generate to package.json in the script with the test

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question