Skip to content

Commit

Permalink
fix: 迁移测试到 jest;修复 生成钉钉签名 错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Oct 30, 2024
1 parent 0ba1b0d commit 4c5adc4
Show file tree
Hide file tree
Showing 6 changed files with 1,901 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ sessions
#public
dist
temp
coverage
22 changes: 22 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import path from 'path'
import type { Config } from 'jest'

const config: Config = {
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
moduleFileExtensions: [
'js',
'json',
'ts',
],
rootDir: '.',
testRegex: '.(test|spec).ts$',
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
coverageDirectory: path.resolve('./coverage'),
testEnvironment: 'node',
}

export default config
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@
"start": "node ./dist/index.mjs",
"release": "semantic-release",
"commit": "git add . && git cz",
"test": "npm run test:e2e",
"test:e2e": "cross-env DEBUG=push:* NODE_ENV=development mocha -r ts-node/register test/register.ts test/**/*.test.ts -R nyan -t 30000",
"test:debug": "cross-env DEBUG=push:* NODE_ENV=development ts-node-dev test/index.test.ts",
"test": "cross-env DEBUG=push:* NODE_ENV=development jest",
"test:cov": "cross-env DEBUG=push:* NODE_ENV=development jest --coverage",
"prepare": "husky install"
},
"devDependencies": {
Expand All @@ -66,6 +65,7 @@
"@semantic-release/git": "^10.0.1",
"@types/crypto-js": "^4.1.0",
"@types/debug": "^4.1.5",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.14.168",
"@types/mocha": "^10.0.1",
"@types/module-alias": "^2.0.0",
Expand All @@ -84,13 +84,15 @@
"eslint-config-cmyr": "^1.1.30",
"eslint-plugin-import": "^2.25.4",
"husky": "^9.0.5",
"jest": "^29.7.0",
"lint-staged": "^15.0.1",
"lodash": "^4.17.21",
"mocha": "^10.0.0",
"module-alias": "^2.2.2",
"rimraf": "^6.0.0",
"semantic-release": "21.1.2",
"should": "^13.2.3",
"ts-jest": "^29.2.5",
"ts-node": "^10.5.0",
"ts-node-dev": "^2.0.0",
"tslib": "^2.6.2",
Expand All @@ -102,7 +104,6 @@
"dependencies": {
"@colors/colors": "^1.5.0",
"axios": "^1.2.1",
"crypto-js": "^4.0.0",
"debug": "^4.3.1",
"https-proxy-agent": "5.0.1",
"nodemailer": "^6.9.1",
Expand Down
Loading

0 comments on commit 4c5adc4

Please sign in to comment.