Skip to content

Commit

Permalink
Fix unintentional test case id overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
rconner46 committed Sep 26, 2023
1 parent ac0a7d9 commit 403eabe
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 43 deletions.
4 changes: 3 additions & 1 deletion dist/index.cjs

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

2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

26 changes: 25 additions & 1 deletion dist/index.d.ts

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

2 changes: 1 addition & 1 deletion dist/index.min.js

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

2 changes: 1 addition & 1 deletion dist/index.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.mjs

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

2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
},
"scripts": {
"clean": "rm -rf ./dist/",
"lint": "eslint ./src/ ./test/ --fix",
"lint-verify": "eslint ./src/ ./test/",
"lint": "eslint ./src/ --fix",
"lint-verify": "eslint ./src/",
"build": "rollup -c --bundleConfigAsCjs",
"test": "yarn jest",
"publish-verify": "npm publish --dry-run",
Expand Down
8 changes: 5 additions & 3 deletions src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ApplauseReporter {
}
}

class RunInitializer {
export class RunInitializer {
constructor(private autoApi: AutoApi) {}

async initializeRun(tests?: string[]): Promise<RunReporter> {
Expand All @@ -97,7 +97,7 @@ class RunInitializer {
}
}

class RunReporter {
export class RunReporter {
private readonly TEST_RAIL_CASE_ID_PREFIX: string = 'TestRail-';
private readonly APPLAUSE_CASE_ID_PREFIX: string = 'Applause-';

Expand All @@ -124,7 +124,9 @@ class RunReporter {

testRunId: this.testRunId,
// If the additional params provides either test case id, it will override the parsed value we set above
...params,
...Object.fromEntries(
Object.entries(params || {}).filter(([_, v]) => v !== undefined)
),
})
.then(res => {
return res.data.testResultId;
Expand Down
Loading

0 comments on commit 403eabe

Please sign in to comment.