From e89e6b744139bb51c019e20c6823e7af6ec0aabf Mon Sep 17 00:00:00 2001 From: Gautam Krishna R Date: Sun, 7 Apr 2024 02:49:36 +0530 Subject: [PATCH] added mocha reports --- .github/workflows/build.yml | 11 +++++++++++ .gitignore | 4 ++++ package.json | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 005f1ac..e6ae681 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,10 @@ on: paths: - '**.js' - 'package.json' +permissions: + contents: read + actions: read + checks: write jobs: test: if: | @@ -25,3 +29,10 @@ jobs: - run: yarn install --frozen-lockfile - run: yarn test - run: yarn build && yarn run test-dist + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: Mocha Tests + path: "*-report.json" + reporter: mocha-json diff --git a/.gitignore b/.gitignore index be52143..8f198bf 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,7 @@ out .yarn/build-state.yml .yarn/install-state.gz .pnp.* + +# reports +src-report.json +dist-report.json diff --git a/package.json b/package.json index 68d0333..119ac4f 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "start-server": "node test/testUtils/test-server.js", "local-run-script": "node local-run.js", "local-run": "start-server-and-test start-server http://localhost:8080 local-run-script", - "test-run": "mocha --parallel --jobs 100 test/**.js", + "test-run": "mocha --parallel --reporter json --reporter-option output=src-report.json --jobs 100 test/**.js", "test": "yarn run lint && start-server-and-test start-server http://localhost:8080 test-run", - "test-run-dist": "DIST=true mocha --parallel --jobs 100 test/**.js", + "test-run-dist": "DIST=true mocha --parallel --reporter json --reporter-option output=dist-report.json --jobs 100 test/**.js", "test-dist": "yarn run lint && start-server-and-test start-server http://localhost:8080 test-run-dist" }, "repository": {