Skip to content

Commit

Permalink
feat: test for express
Browse files Browse the repository at this point in the history
  • Loading branch information
KairuiLiu committed May 8, 2024
1 parent 5deab42 commit 07630fa
Show file tree
Hide file tree
Showing 7 changed files with 2,153 additions and 44 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,4 @@ dist
.pnp.*
ConFlux
.rollup.cache
uploads
22 changes: 22 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
globals: {
'ts-jest': {
useESM: true,
},
},
transform: {
'^.+\\.ts$': 'ts-jest',
},
testMatch: [
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1"
}
};
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"build": "rollup -c",
"format": "prettier --write --loglevel silent",
"lint": "eslint --fix",
"type-check": "tsc --noEmit; tsc --noEmit -p create-vite-express/tsconfig.json"
"type-check": "tsc --noEmit; tsc --noEmit -p create-vite-express/tsconfig.json",
"test": "jest"
},
"keywords": [],
"author": "Kairui Liu",
Expand All @@ -28,13 +29,15 @@
"@types/express": "^4.17.21",
"@types/express-serve-static-core": "^4.19.0",
"@types/express-unless": "^2.0.1",
"@types/jest": "^29.5.12",
"@types/jsonwebtoken": "^9.0.6",
"@types/mime-types": "^2.1.4",
"@types/morgan": "^1.9.9",
"@types/multer": "^1.4.11",
"@types/node": "^20.12.7",
"@types/qs": "^6.9.14",
"@types/socket.io": "^3.0.2",
"@types/supertest": "^6.0.2",
"@types/uuid": "^9.0.8",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^6.21.0",
Expand All @@ -45,11 +48,14 @@
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"globals": "^15.0.0",
"jest": "^29.7.0",
"nodemon": "^3.1.0",
"prettier": "^3.2.5",
"rollup": "^4.14.2",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-delete": "^2.0.0",
"supertest": "^7.0.0",
"ts-jest": "^29.1.2",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.6.0"
Expand Down
Loading

0 comments on commit 07630fa

Please sign in to comment.