Skip to content

Commit

Permalink
Updated build and testing with coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jezzsantos committed Jan 2, 2025
1 parent e33d506 commit a694a91
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
if: success() || failure()
Expand Down
7 changes: 5 additions & 2 deletions src/Tools.GitHubActions/VariableSubstitution/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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,
Expand Down
111 changes: 111 additions & 0 deletions src/Tools.GitHubActions/VariableSubstitution/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Tools.GitHubActions/VariableSubstitution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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<ILogger> = {
Expand Down
4 changes: 2 additions & 2 deletions src/WebsiteHost/ClientApp/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit a694a91

Please sign in to comment.