Integrate `jest` testing framework

This commit is contained in:
Thach Nguyen 2022-07-28 09:22:21 +07:00
parent 616953088d
commit 0bac8fc957
4 changed files with 4904 additions and 7 deletions

View File

@ -18,7 +18,7 @@ jobs:
Clone this repository and build the project with command
```batch
docker run --rm -it -v "%PWD%:/usr/src/app" -w /usr/src/app node:12-alpine /bin/sh -c "npm i --no-bin-links && npm run format-check && npm run build"
docker run --rm -it -v "%PWD%:/usr/src/app" -w /usr/src/app node:12-alpine /bin/sh -c "npm i --no-bin-links && npm test && npm run build"
```
**Note** that `%PWD%` is the project working directory in `Unix` format, such as: `/c/Users/source/repos/setup-maven`

4886
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,10 @@
"scripts": {
"build": "npm run ncc -- build -o dist src/setup-maven.ts",
"format": "npm run prettier -- \"{,!(dist)/**/}?*.*\" --write",
"format-check": "npm run prettier -- \"{,!(dist)/**/}?*.*\" --check",
"lint": "npm run prettier -- \"{,!(dist)/**/}?*.*\" --check",
"ncc": "node node_modules/@vercel/ncc/dist/ncc/cli.js",
"prettier": "node node_modules/prettier/bin-prettier.js --ignore-path .gitignore"
"prettier": "node node_modules/prettier/bin-prettier.js --ignore-path .gitignore",
"test": "npm run lint && node node_modules/jest/bin/jest.js"
},
"keywords": [
"actions",
@ -26,10 +27,14 @@
"semver": "^6.1.1"
},
"devDependencies": {
"@types/jest": "^26.0.15",
"@types/node": "^12.0.4",
"@types/semver": "^6.0.0",
"@vercel/ncc": "^0.24.1",
"jest": "^26.3.0",
"jest-circus": "^26.3.0",
"prettier": "^1.17.1",
"ts-jest": "^26.2.0",
"typescript": "^3.5.1"
},
"prettier": {
@ -37,5 +42,17 @@
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "avoid"
},
"jest": {
"clearMocks": true,
"testEnvironment": "node",
"testMatch": [
"**/*.test.ts"
],
"testRunner": "jest-circus/runner",
"transform": {
"\\.ts$": "ts-jest"
},
"verbose": true
}
}

View File

@ -8,5 +8,5 @@
"noImplicitAny": true,
"esModuleInterop": true
},
"exclude": ["__tests__", "lib", "node_modules"]
"exclude": ["node_modules", "lib", "**/*.test.ts"]
}