From 32cb635e08ab5f992acbdbc08d5141898742545a Mon Sep 17 00:00:00 2001 From: Duncan McPherson Date: Sat, 16 Dec 2023 08:48:13 -0700 Subject: [PATCH] fix test commands --- .github/workflows/test.yml | 2 +- jest.config.js | 3 ++- package-lock.json | 43 ++++++++++++++++++++++++++++++++++++++ package.json | 11 +++++++++- 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e15ad8..8e4fd04 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,4 +22,4 @@ jobs: if: always() with: files: | - test-results/**/*.xml \ No newline at end of file + test-results/junit.xml \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 81bf4dd..1d5b3c9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,5 +14,6 @@ module.exports = { lines: 95, statements: 95 } - } + }, + reporters: ['default', 'jest-junit'] }; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3cdd2a5..75fe8a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "@types/jest": "^29.5.11", "@types/lodash": "^4.14.202", "jest-jasmine2": "^29.7.0", + "jest-junit": "^16.0.0", "ts-node": "^10.9.2", "tsup": "^8.0.1", "typescript": "^5.3.3" @@ -4508,6 +4509,21 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-junit": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-16.0.0.tgz", + "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/jest-leak-detector": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -5068,6 +5084,18 @@ "node": "*" } }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -6163,6 +6191,15 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -6263,6 +6300,12 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index f107108..09caf29 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "'./dist/index.d.ts", - "files": ["/dist/*"], + "files": [ + "/dist/*" + ], "scripts": { "build": "tsup", "test": "jest --config=./jest.config.js" @@ -24,6 +26,12 @@ "bugs": { "url": "https://github.com/DuncanMcPherson/test-utils/issues" }, + "jest-junit": { + "outputDirectory": "./test-results", + "classNameTemplate": "{classname}", + "titleTemplate": "{title}", + "ancestorSeparator": ">" + }, "homepage": "https://github.com/DuncanMcPherson/test-utils#readme", "devDependencies": { "@babel/core": "^7.23.5", @@ -32,6 +40,7 @@ "@types/jest": "^29.5.11", "@types/lodash": "^4.14.202", "jest-jasmine2": "^29.7.0", + "jest-junit": "^16.0.0", "ts-node": "^10.9.2", "tsup": "^8.0.1", "typescript": "^5.3.3"