Skip to content

Commit c90c6a4

Browse files
authoredJan 4, 2022
style: allow devs to test both build and tests at the same time (#1707)
The docker:rebuild script rebuilds the docker image from scratch including the Docsify build, while the new one rebuilds only Docsify code and makes local re-testing faster.
1 parent 5cac06d commit c90c6a4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
 

‎package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"lint": "eslint .",
2929
"fixlint": "eslint . --fix",
3030
"test": "jest",
31+
"build:test": "npm run build && npm test",
3132
"test:e2e": "jest --selectProjects e2e",
3233
"test:integration": "jest --selectProjects integration",
3334
"test:unit": "jest --selectProjects unit",
@@ -47,10 +48,12 @@
4748
"docker:build": "docker build -f Dockerfile -t docsify-test:local .",
4849
"docker:clean": "docker rmi docsify-test:local",
4950
"docker:rebuild": "npm run docker:clean && npm run docker:build",
50-
"docker:test": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test",
51-
"docker:test:e2e": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:e2e",
52-
"docker:test:integration": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:integration",
53-
"docker:test:unit": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:unit"
51+
"docker:test": "npm run docker:cli -- test",
52+
"docker:build:test": "npm run docker:cli -- build:test",
53+
"docker:test:e2e": "npm run docker:cli -- test:e2e",
54+
"docker:test:integration": "npm run docker:cli -- test:integration",
55+
"docker:test:unit": "npm run docker:cli -- test:unit",
56+
"docker:cli": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local"
5457
},
5558
"husky": {
5659
"hooks": {

1 commit comments

Comments
 (1)
Please sign in to comment.