Integrate `jest` testing framework
This commit is contained in:
parent
616953088d
commit
0bac8fc957
|
@ -18,7 +18,7 @@ jobs:
|
||||||
Clone this repository and build the project with command
|
Clone this repository and build the project with command
|
||||||
|
|
||||||
```batch
|
```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`
|
**Note** that `%PWD%` is the project working directory in `Unix` format, such as: `/c/Users/source/repos/setup-maven`
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
21
package.json
21
package.json
|
@ -7,9 +7,10 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run ncc -- build -o dist src/setup-maven.ts",
|
"build": "npm run ncc -- build -o dist src/setup-maven.ts",
|
||||||
"format": "npm run prettier -- \"{,!(dist)/**/}?*.*\" --write",
|
"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",
|
"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": [
|
"keywords": [
|
||||||
"actions",
|
"actions",
|
||||||
|
@ -26,10 +27,14 @@
|
||||||
"semver": "^6.1.1"
|
"semver": "^6.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/jest": "^26.0.15",
|
||||||
"@types/node": "^12.0.4",
|
"@types/node": "^12.0.4",
|
||||||
"@types/semver": "^6.0.0",
|
"@types/semver": "^6.0.0",
|
||||||
"@vercel/ncc": "^0.24.1",
|
"@vercel/ncc": "^0.24.1",
|
||||||
|
"jest": "^26.3.0",
|
||||||
|
"jest-circus": "^26.3.0",
|
||||||
"prettier": "^1.17.1",
|
"prettier": "^1.17.1",
|
||||||
|
"ts-jest": "^26.2.0",
|
||||||
"typescript": "^3.5.1"
|
"typescript": "^3.5.1"
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
|
@ -37,5 +42,17 @@
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"bracketSpacing": true,
|
"bracketSpacing": true,
|
||||||
"arrowParens": "avoid"
|
"arrowParens": "avoid"
|
||||||
|
},
|
||||||
|
"jest": {
|
||||||
|
"clearMocks": true,
|
||||||
|
"testEnvironment": "node",
|
||||||
|
"testMatch": [
|
||||||
|
"**/*.test.ts"
|
||||||
|
],
|
||||||
|
"testRunner": "jest-circus/runner",
|
||||||
|
"transform": {
|
||||||
|
"\\.ts$": "ts-jest"
|
||||||
|
},
|
||||||
|
"verbose": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,5 +8,5 @@
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"esModuleInterop": true
|
"esModuleInterop": true
|
||||||
},
|
},
|
||||||
"exclude": ["__tests__", "lib", "node_modules"]
|
"exclude": ["node_modules", "lib", "**/*.test.ts"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue