diff --git a/dist/modules/auth/auth.test.js b/dist/modules/auth/auth.test.js index 5b32f09..32945c6 100644 --- a/dist/modules/auth/auth.test.js +++ b/dist/modules/auth/auth.test.js @@ -5,6 +5,7 @@ import httpStatus from 'http-status'; import httpMocks from 'node-mocks-http'; import moment from 'moment'; import bcrypt from 'bcryptjs'; +import { jest } from '@jest/globals'; import app from '../../app'; import setupTestDB from '../jest/setupTestDB'; import User from '../user/user.model'; diff --git a/jest.config.js b/jest.config.cjs similarity index 93% rename from jest.config.js rename to jest.config.cjs index 3b4ea00..9c37759 100644 --- a/jest.config.js +++ b/jest.config.cjs @@ -4,7 +4,7 @@ module.exports = { NODE_ENV: 'test', }, restoreMocks: true, - coveragePathIgnorePatterns: ['node_modules', 'dist/config', 'dist/app.js', 'tests'], + coveragePathIgnorePatterns: ['node_modules', 'dist/config', 'dist/app.js'], coverageReporters: ['text', 'lcov', 'clover', 'html'], globals: { 'ts-jest': { diff --git a/package.json b/package.json index 9b0d565..789202a 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "scripts": { "start": "pm2 start ecosystem.config.json --no-daemon", "dev": "cross-env NODE_ENV=development nodemon --experimental-modules --es-module-specifier-resolution=node dist/index.js", - "test": "jest -i --colors --verbose --detectOpenHandles", - "test:watch": "jest -i --watchAll", - "coverage": "jest -i --coverage", - "coverage:coveralls": "jest -i --coverage --coverageReporters=text-lcov | coveralls", + "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest -i --colors --verbose --detectOpenHandles", + "test:watch": "cross-env NODE_OPTIONS=--experimental-vm-modules jest -i --watchAll", + "coverage": "cross-env NODE_OPTIONS=--experimental-vm-modules jest -i --coverage", + "coverage:coveralls": "cross-env NODE_OPTIONS=--experimental-vm-modules jest -i --coverage --coverageReporters=text-lcov | coveralls", "lint": "eslint .", "lint:fix": "eslint . --fix", "prettier": "prettier --check **/*.js", @@ -23,8 +23,7 @@ "docker:test": "docker-compose -f docker-compose.yml -f docker-compose.test.yml up", "prepare": "husky install", "compile": "tsc --build && eslint . --fix", - "compile:watch": "tsc --build src --watch", - "postinstall": "./node_modules/.bin/pm2 install typescript" + "compile:watch": "tsc --build src --watch" }, "keywords": [ "node", diff --git a/src/modules/auth/auth.test.ts b/src/modules/auth/auth.test.ts index 1bb4d26..38dbb24 100644 --- a/src/modules/auth/auth.test.ts +++ b/src/modules/auth/auth.test.ts @@ -5,6 +5,7 @@ import httpStatus from 'http-status'; import httpMocks from 'node-mocks-http'; import moment from 'moment'; import bcrypt from 'bcryptjs'; +import { jest } from '@jest/globals'; import app from '../../app'; import setupTestDB from '../jest/setupTestDB'; import User from '../user/user.model';