From 0dd13c7353c6e1dc1e12ded4b76376229b6a358e Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Mon, 3 Jan 2022 22:52:31 -0800 Subject: [PATCH] add build:test and docker:build:test scripts to allow devs to test both build and tests at the same time 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. --- package.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index fcdec3c52..338e4aa95 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "lint": "eslint .", "fixlint": "eslint . --fix", "test": "jest", + "build:test": "npm run build && npm test", "test:e2e": "jest --selectProjects e2e", "test:integration": "jest --selectProjects integration", "test:unit": "jest --selectProjects unit", @@ -47,10 +48,12 @@ "docker:build": "docker build -f Dockerfile -t docsify-test:local .", "docker:clean": "docker rmi docsify-test:local", "docker:rebuild": "npm run docker:clean && npm run docker:build", - "docker:test": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test", - "docker:test:e2e": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:e2e", - "docker:test:integration": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:integration", - "docker:test:unit": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:unit" + "docker:test": "npm run docker:cli -- test", + "docker:build:test": "npm run docker:cli -- build:test", + "docker:test:e2e": "npm run docker:cli -- test:e2e", + "docker:test:integration": "npm run docker:cli -- test:integration", + "docker:test:unit": "npm run docker:cli -- test:unit", + "docker:cli": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local" }, "husky": { "hooks": {