Skip to content

The open alternative to Salesforce, designed for AI.

Rename test commands (coverage storybook) (#476)

Emilien Chauvet30fd3320b71e
diff --git a/.github/workflows/ci-front.yaml b/.github/workflows/ci-front.yaml
index 2d78c719310..ec09467340f 100644
--- a/.github/workflows/ci-front.yaml
+++ b/.github/workflows/ci-front.yaml
@@ -34,7 +34,7 @@ jobs:
run: |
cd front && npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --silent --port 6006" \
- "yarn coverage"
+ "yarn coverage-storybook"
- name: Front / Run jest tests
run: |
cd front && yarn test
diff --git a/docs/docs/dev/workflows.mdx b/docs/docs/dev/workflows.mdx
index be9596e61d1..b99f0435680 100644
--- a/docs/docs/dev/workflows.mdx
+++ b/docs/docs/dev/workflows.mdx
@@ -14,6 +14,7 @@ This will allow you to run Visual Studio on top of the docker container.
## Front tests
Run tests: `make front-test`
+Run tests with coverage: `make front-coverage`
## Running commands
If you are using Docker install, make sure to ssh in the docker container during development to execute commands.
diff --git a/front/package.json b/front/package.json
index a7c7e5359ba..5a29c96eb0e 100644
--- a/front/package.json
+++ b/front/package.json
@@ -41,11 +41,12 @@
"start": "PORT=3001 craco start",
"build": "craco build",
"test": "craco test",
+ "coverage": "craco test --coverage .",
"lint": "eslint src --max-warnings=0",
"storybook": "storybook dev -p 6006 -s ../public",
"test-storybook": "test-storybook",
"build-storybook": "storybook build -s public",
- "coverage": "test-storybook --coverage && npx nyc report --reporter=lcov -t coverage/storybook --report-dir coverage/storybook --check-coverage",
+ "coverage-storybook": "test-storybook --coverage && npx nyc report --reporter=lcov -t coverage/storybook --report-dir coverage/storybook --check-coverage",
"graphql:generate": "dotenv cross-var graphql-codegen --config codegen.js",
"chromatic": "dotenv cross-var npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN"
},
diff --git a/infra/dev/Makefile b/infra/dev/Makefile
index ed1e03dcbb4..718157aec90 100644
--- a/infra/dev/Makefile
+++ b/infra/dev/Makefile
@@ -23,6 +23,9 @@ front-lint:
front-test:
@docker-compose exec twenty-dev sh -c "cd /app/front && yarn test"
+front-coverage:
+ @docker-compose exec twenty-dev sh -c "cd /app/front && yarn coverage"
+
front-graphql-generate:
@docker-compose exec twenty-dev sh -c "cd /app/front && yarn graphql:generate"