diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7d9ae91..deb94a80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,6 +90,13 @@ jobs: npm ci --cache .npm --prefer-offline npm run build:releasefordeploy npm run test:ci + - name: Test VariableSubstitution (GitHubAction) + continue-on-error: false + run: | + cd src/Tools.GitHubActions/VariableSubstitution + npm ci --cache .npm --prefer-offline + npm run build + npm run test:ci - name: Testing Report uses: dorny/test-reporter@v1.7.0 if: success() || failure() diff --git a/src/Tools.GitHubActions/VariableSubstitution/jest.config.ts b/src/Tools.GitHubActions/VariableSubstitution/jest.config.ts index fabfb0a8..83602b70 100644 --- a/src/Tools.GitHubActions/VariableSubstitution/jest.config.ts +++ b/src/Tools.GitHubActions/VariableSubstitution/jest.config.ts @@ -25,7 +25,7 @@ const config: Config = { // collectCoverageFrom: undefined, // The directory where Jest should output its coverage files - coverageDirectory: "coverage", + coverageDirectory: "../../TestResults/githubactions/variablesubstitution", // An array of regexp pattern strings used to skip coverage collection // coveragePathIgnorePatterns: [ @@ -103,7 +103,10 @@ const config: Config = { // projects: undefined, // Use this configuration option to add custom reporters to Jest - // reporters: undefined, + reporters: ["default", ["jest-junit", { + outputDirectory: "../../TestResults/githubactions/variablesubstitution", + outputName: "junit.xml" + }]], // Automatically reset mock state before every test // resetMocks: false, diff --git a/src/Tools.GitHubActions/VariableSubstitution/package-lock.json b/src/Tools.GitHubActions/VariableSubstitution/package-lock.json index 2550429f..78db72c4 100644 --- a/src/Tools.GitHubActions/VariableSubstitution/package-lock.json +++ b/src/Tools.GitHubActions/VariableSubstitution/package-lock.json @@ -21,6 +21,7 @@ "babel-jest": "^29.7.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "jest-junit": "^16.0.0", "ts-node": "^10.9.2", "typescript": "^5.7.2" } @@ -4300,6 +4301,42 @@ "fsevents": "^2.3.2" } }, + "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-junit/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-junit/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/jest-leak-detector": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -4924,6 +4961,18 @@ "node": ">=16 || 14 >=14.17" } }, + "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.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -5992,6 +6041,15 @@ "requires-port": "^1.0.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", @@ -6219,6 +6277,12 @@ } } }, + "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/xml-name-validator": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", @@ -9464,6 +9528,35 @@ "walker": "^1.0.8" } }, + "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, + "requires": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "jest-leak-detector": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -9947,6 +10040,12 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -10712,6 +10811,12 @@ "requires-port": "^1.0.0" } }, + "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 + }, "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", @@ -10874,6 +10979,12 @@ "dev": true, "requires": {} }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "xml-name-validator": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", diff --git a/src/Tools.GitHubActions/VariableSubstitution/package.json b/src/Tools.GitHubActions/VariableSubstitution/package.json index c966a779..581a409a 100644 --- a/src/Tools.GitHubActions/VariableSubstitution/package.json +++ b/src/Tools.GitHubActions/VariableSubstitution/package.json @@ -23,6 +23,7 @@ "babel-jest": "^29.7.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "jest-junit": "^16.0.0", "ts-node": "^10.9.2", "typescript": "^5.7.2" } diff --git a/src/Tools.GitHubActions/VariableSubstitution/src/configurationSets.spec.ts b/src/Tools.GitHubActions/VariableSubstitution/src/configurationSets.spec.ts index 0368288a..9b4d8a80 100644 --- a/src/Tools.GitHubActions/VariableSubstitution/src/configurationSets.spec.ts +++ b/src/Tools.GitHubActions/VariableSubstitution/src/configurationSets.spec.ts @@ -1,6 +1,6 @@ import {ConfigurationSets} from "./configurationSets"; -import {ILogger} from "./Logger"; -import {IGlobPatternParser} from "./GlobPatternParser"; +import {ILogger} from "./logger"; +import {IGlobPatternParser} from "./globPatternParser"; describe('ConfigurationSets', () => { const logger: jest.Mocked = { diff --git a/src/WebsiteHost/ClientApp/jest.config.ts b/src/WebsiteHost/ClientApp/jest.config.ts index ff410c66..1e6ed984 100644 --- a/src/WebsiteHost/ClientApp/jest.config.ts +++ b/src/WebsiteHost/ClientApp/jest.config.ts @@ -3,7 +3,7 @@ * https://jestjs.io/docs/configuration */ -import type { Config } from "jest"; +import type {Config} from "jest"; const config: Config = { // All imported modules in your tests should be mocked automatically @@ -19,7 +19,7 @@ const config: Config = { clearMocks: true, // Indicates whether the coverage information should be collected while executing the test - // collectCoverage: false, + collectCoverage: false, // An array of glob patterns indicating a set of files for which coverage information should be collected // collectCoverageFrom: undefined,