From f7090965efbc945764d8d09bc830487a3cb1b0ba Mon Sep 17 00:00:00 2001 From: Markus Bucher Date: Wed, 20 Dec 2023 18:02:51 +0100 Subject: [PATCH] WIP: test-result reporting --- .github/workflows/unit_tests.yml | 2 +- jest.config.js | 6 ++++++ package.json | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 jest.config.js diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index e983a1af..ee9e9df6 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -74,7 +74,7 @@ jobs: - name: Run npm tests working-directory: ./foreman_acd run: | - npm test + npm test-github-actions - name: Run access permission test run: | bundle exec rake test TEST="test/unit/foreman/access_permissions_test.rb" diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000..d69e1960 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + reporters: [ + "default", + "jest-github-actions-reporter" + ] +}; diff --git a/package.json b/package.json index 40e70189..04332b44 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "babel-preset-env": "^1.6.0", "babel-preset-react": "^6.24.1", "jest": "^23.6.0", + "jest-github-actions-reporter": "^1.0.3", "jest-prop-type-error": "^1.1.0", "lodash": "^4.17.11", "react-redux-test-utils": "^0.1.1", @@ -25,7 +26,8 @@ "table-resolver": "^3.2.0" }, "scripts": { - "test": "node node_modules/.bin/jest --no-cache" + "test": "node node_modules/.bin/jest --no-cache", + "test-github-actions": "CI=true node node_modules/.bin/jest --no-cache --reporters=default --reporters=jest-github-actions-reporter" }, "repository": { "type": "git",