-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: re-write some files to typescript - part 3 #489
chore: re-write some files to typescript - part 3 #489
Conversation
@@ -2,6 +2,7 @@ | |||
/* eslint-env browser */ | |||
|
|||
const {isEmpty} = require('lodash'); | |||
/** @type Record<string, (...args: unknown[]) => unknown> */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пришлось добавить временно jsdoc, чтобы не ругался компилятор tsc
addSkipped(result) { | ||
const formattedResult = this.format(result); | ||
addSkipped(result: TestResult | TestAdapter): TestAdapter { | ||
const formattedResult = this.format(result, SKIPPED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут показалось логичным всегда передавать статус, но обсуждаемо.
Конкретно в этом месте есть разница в поведении в runtime. Ранее передавался undefined, следовательно условие в test-adapter:
if (utils.shouldUpdateAttempt(status)) { // ![SKIPPED, UPDATED, RUNNING, IDLE].includes(status);
testsAttempts.set(this._testId, _.isUndefined(testsAttempts.get(this._testId)) ? 0 : testsAttempts.get(this._testId) as number + 1);
}
Выполнялось. Стали передавать SKIPPED — оно выполняться перестанет.
@@ -91,6 +91,8 @@ export class TestAdapter { | |||
this._attempt = testsAttempts.get(this._testId) || 0; | |||
} | |||
|
|||
image?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пришлось добавить из-за строки в static report builder:
formattedResult.image = hasImage(formattedResult);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok
198c456
to
6d04d3e
Compare
What's done?
Why?