mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 07:07:21 +00:00
Add Jest configuration and dummy test
This commit is contained in:
24
jest.config.js
Normal file
24
jest.config.js
Normal file
@ -0,0 +1,24 @@
|
||||
module.exports = {
|
||||
moduleFileExtensions: [
|
||||
"js",
|
||||
"json",
|
||||
"ts"
|
||||
],
|
||||
rootDir: ".",
|
||||
testRegex: ".*\\.spec\\.ts$",
|
||||
transform: {
|
||||
"^.+\\.(t|j)s$": "ts-jest"
|
||||
},
|
||||
collectCoverageFrom: [
|
||||
"**/*.(t|j)s"
|
||||
],
|
||||
coverageDirectory: "./coverage",
|
||||
testEnvironment: "node",
|
||||
roots: [
|
||||
"<rootDir>/src/",
|
||||
"<rootDir>/libs/"
|
||||
],
|
||||
moduleNameMapper: {
|
||||
"^@app/common(|/.*)$": "<rootDir>/libs/common/src/$1"
|
||||
}
|
||||
};
|
5
libs/common/dummy.spec.ts
Normal file
5
libs/common/dummy.spec.ts
Normal file
@ -0,0 +1,5 @@
|
||||
describe('Dummy Test', () => {
|
||||
it('should pass', () => {
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
});
|
30
package.json
30
package.json
@ -13,9 +13,9 @@
|
||||
"start:debug": "npx nest start --debug --watch",
|
||||
"start:prod": "node dist/main",
|
||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:cov": "jest --coverage",
|
||||
"test": "jest --config jest.config.js",
|
||||
"test:watch": "jest --watch --config jest.config.js",
|
||||
"test:cov": "jest --coverage --config jest.config.js",
|
||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||
"test:e2e": "jest --config ./apps/backend/test/jest-e2e.json"
|
||||
},
|
||||
@ -72,29 +72,5 @@
|
||||
"ts-node": "^10.9.1",
|
||||
"tsconfig-paths": "^4.2.0",
|
||||
"typescript": "^5.1.3"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"json",
|
||||
"ts"
|
||||
],
|
||||
"rootDir": ".",
|
||||
"testRegex": ".*\\.spec\\.ts$",
|
||||
"transform": {
|
||||
"^.+\\.(t|j)s$": "ts-jest"
|
||||
},
|
||||
"collectCoverageFrom": [
|
||||
"**/*.(t|j)s"
|
||||
],
|
||||
"coverageDirectory": "./coverage",
|
||||
"testEnvironment": "node",
|
||||
"roots": [
|
||||
"<rootDir>/apps/",
|
||||
"<rootDir>/libs/"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"^@app/common(|/.*)$": "<rootDir>/libs/common/src/$1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
5
src/dummy.spec.ts
Normal file
5
src/dummy.spec.ts
Normal file
@ -0,0 +1,5 @@
|
||||
describe('Dummy Test', () => {
|
||||
it('should pass', () => {
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user