Skip to content

Commit

Permalink
fix: support testIdAttribute in Codegen when using TestServer (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Feb 18, 2025
1 parent f12d971 commit 537d8f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/upstream/reporter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type FullProject = {
snapshotDir: string;
retries: number;
repeatEach: number;
use: unknown;
use: { [key: string]: any; };
};

interface FullReporterV2 {
Expand Down
7 changes: 7 additions & 0 deletions src/upstream/teleEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,17 @@ export class TeleReporterEmitter implements ReporterV2 {
dependencies: project.dependencies,
snapshotDir: this._relativePath(project.snapshotDir),
teardown: project.teardown,
use: this._serializeProjectUseOptions(project.use),
};
return report;
}

private _serializeProjectUseOptions(use: reporterTypes.FullProject['use']): Record<string, any> {
return {
testIdAttribute: use.testIdAttribute,
};
}

private _serializeSuite(suite: reporterTypes.Suite): teleReceiver.JsonSuite {
const result = {
title: suite.title,
Expand Down
3 changes: 2 additions & 1 deletion src/upstream/teleReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export type JsonProject = {
testIgnore: JsonPattern[];
testMatch: JsonPattern[];
timeout: number;
use: { [key: string]: any };
};

export type JsonSuite = {
Expand Down Expand Up @@ -327,7 +328,7 @@ export class TeleReporterReceiver {
dependencies: project.dependencies,
teardown: project.teardown,
snapshotDir: this._absolutePath(project.snapshotDir),
use: {},
use: project.use,
};
}

Expand Down

0 comments on commit 537d8f5

Please sign in to comment.