Skip to content

Commit

Permalink
feat: improve codeceptjs step logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Dec 10, 2024
1 parent f0753df commit dc6aab1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/allure-codeceptjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
},
"dependencies": {
"allure-js-commons": "workspace:*",
"allure-mocha": "workspace:*"
"allure-mocha": "workspace:*",
"invisi-data": "^1.1.2"
},
"devDependencies": {
"@babel/cli": "^7.24.6",
Expand Down
4 changes: 3 additions & 1 deletion packages/allure-codeceptjs/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { LabelName, Stage, Status, type StepResult } from "allure-js-commons";
import { getMessageAndTraceFromError, getStatusFromError, isMetadataTag } from "allure-js-commons/sdk";
import AllureMochaReporter from "allure-mocha";
import type { CodeceptError, CodeceptStep } from "./model.js";
import { maskSensitiveData } from "invisi-data";

export class AllureCodeceptJsReporter extends AllureMochaReporter {
constructor(runner: Mocha.Runner, opts: Mocha.MochaOptions, isInWorker: boolean) {
Expand Down Expand Up @@ -47,7 +48,8 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
}
this.runtime.startStep(root, undefined, {
name: `${step.actor} ${step.name}`,
parameters: step.args?.map((arg, index) => ({ name: `arg${index}`, value: `${arg}` })),
// @ts-ignore
parameters: step.args?.map((arg, index) => ({ name: `arg${index}`, value: `${ global.maskSensitiveData ? maskSensitiveData(JSON.stringify(arg)) : JSON.stringify(arg)}` })),
});
}

Expand Down

0 comments on commit dc6aab1

Please sign in to comment.