Skip to content

Commit

Permalink
Merge pull request #194 from Hargne/dev
Browse files Browse the repository at this point in the history
Release 4.0.1
  • Loading branch information
Hargne authored Feb 11, 2025
2 parents fdd512f + 4986b11 commit ba82b24
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
test-report/
dist/
report.html
test-report.html
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,24 @@ To run the reporter as a test results processor (after Jest is complete instead
}
```

***Note:** When running as a testResultsProcessor, the configuration needs be placed within a new file named `jesthtmlreporter.config.json` residing in the root folder.*
**Note:** When running as a testResultsProcessor, the configuration needs either to be placed within a new file named `jesthtmlreporter.config.json` residing in the root folder

```JSON
{
"pageTitle": "Test Report",
}
```

or via adding a key to `package.json` named "jest-html-reporter":

```JSON
{
...
"jest-html-reporter": {
"pageTitle": "Test Report",
}
}
```

## 📌 Configuration Options (All Optional)

Expand Down Expand Up @@ -93,7 +110,7 @@ All the configuration options provided in the table above are available via envi

**Example:** `customScriptPath` -> `JEST_HTML_REPORTER_CUSTOM_SCRIPT_PATH`

***NOTE:** Environment variables will take precedence over configurations set in jesthtmlreporter.config.json and package.json*
**\*NOTE:** Environment variables will take precedence over configurations set in jesthtmlreporter.config.json and package.json\*

### CI Example

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jest-html-reporter",
"version": "4.0.0",
"version": "4.0.1",
"description": "Jest test results processor for generating a summary in HTML",
"main": "dist/index.js",
"unpkg": "dist/index.js",
Expand Down
4 changes: 3 additions & 1 deletion src/extractConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export default function (cliConfig: unknown): JestHTMLReporterConfiguration {
path.join(process.cwd(), "jesthtmlreporter.config.json")
);
const packageJsonConfig =
readJsonFile(path.join(process.cwd(), "package.json"))?.jest || {};
readJsonFile(path.join(process.cwd(), "package.json"))[
"jest-html-reporter"
] || {};

// Merge configurations in priority order (with sanitization)
return {
Expand Down

0 comments on commit ba82b24

Please sign in to comment.