chore: remove unused project to id mapping from html builder (#31698)

This commit is contained in:
Yury Semikhatsky 2024-07-15 14:35:11 -07:00 committed by GitHub
parent 0aa2f06f68
commit 37ffbd757e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -226,8 +226,6 @@ class HtmlBuilder {
private _dataZipFile: ZipFile;
private _hasTraces = false;
private _attachmentsBaseURL: string;
private _projectToId: Map<Suite, number> = new Map();
private _lastProjectId = 0;
constructor(config: FullConfig, outputDir: string, attachmentsBaseURL: string) {
this._config = config;
@ -406,16 +404,6 @@ class HtmlBuilder {
};
}
private _projectId(suite: Suite): number {
const project = projectSuite(suite);
let id = this._projectToId.get(project);
if (!id) {
id = ++this._lastProjectId;
this._projectToId.set(project, id);
}
return id;
}
private _serializeAttachments(attachments: JsonAttachment[]) {
let lastAttachment: TestAttachment | undefined;
return attachments.map(a => {
@ -653,10 +641,4 @@ function createSnippets(stepsInFile: MultiMap<string, TestStep>) {
}
}
function projectSuite(suite: Suite): Suite {
while (suite.parent?.parent)
suite = suite.parent;
return suite;
}
export default HtmlReporter;