diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05f4eae0..fd1ade8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,7 @@ jobs: DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test - name: Run tests - run: npm test + run: npm run test:all env: DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test JWT_SECRET: test-secret-key diff --git a/jest.config.js b/jest.config.js index bad71ffd..3543d22d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -12,4 +12,5 @@ module.exports = { testEnvironment: 'node', testTimeout: 30000, passWithNoTests: true, + testPathIgnorePatterns: ['/test/database/'], }; diff --git a/package.json b/package.json index ac129317..9c3e5750 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ "start:prod": "node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", + "test:all": "jest && jest test/database --runInBand", + "test:database": "jest test/database --runInBand", "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",