Skip to content

Commit a02d90e

Browse files
authored
chore: some fields can be readonly (#2394)
1 parent 9dde5d0 commit a02d90e

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/models/test_case_hook_definition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ export default class TestCaseHookDefinition
3030
async getInvocationParameters({
3131
hookParameter,
3232
}: IGetInvocationDataRequest): Promise<IGetInvocationDataResponse> {
33-
return await Promise.resolve({
33+
return {
3434
getInvalidCodeLengthMessage: () =>
3535
this.buildInvalidCodeLengthMessage('0 or 1', '2'),
3636
parameters: [hookParameter],
3737
validCodeLengths: [0, 1, 2],
38-
})
38+
}
3939
}
4040
}

src/models/test_step_hook_definition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ export default class TestStepHookDefinition
2828
async getInvocationParameters({
2929
hookParameter,
3030
}: IGetInvocationDataRequest): Promise<IGetInvocationDataResponse> {
31-
return await Promise.resolve({
31+
return {
3232
getInvalidCodeLengthMessage: () =>
3333
this.buildInvalidCodeLengthMessage('0 or 1', '2'),
3434
parameters: [hookParameter],
3535
validCodeLengths: [0, 1, 2],
36-
})
36+
}
3737
}
3838
}

src/runtime/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class Runtime implements IRuntime {
4242
private readonly pickleIds: string[]
4343
private readonly supportCodeLibrary: SupportCodeLibrary
4444
private success: boolean
45-
private runTestRunHooks: RunsTestRunHooks
45+
private readonly runTestRunHooks: RunsTestRunHooks
4646

4747
constructor({
4848
eventBroadcaster,

src/runtime/parallel/coordinator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export default class Coordinator implements IRuntime {
5858
private readonly newId: IdGenerator.NewId
5959
private readonly pickleIds: string[]
6060
private assembledTestCases: IAssembledTestCases
61-
private inProgressPickles: Record<string, messages.Pickle>
62-
private workers: Record<string, IWorker>
61+
private readonly inProgressPickles: Record<string, messages.Pickle>
62+
private readonly workers: Record<string, IWorker>
6363
private readonly supportCodeLibrary: SupportCodeLibrary
6464
private readonly requireModules: string[]
6565
private readonly requirePaths: string[]

src/user_code_runner_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ describe('UserCodeRunner', () => {
192192
it('returns what the promise resolves to', async function () {
193193
// Arrange
194194
const fn = async function (): Promise<string> {
195-
return await Promise.resolve('result')
195+
return 'result'
196196
}
197197

198198
// Act
@@ -208,7 +208,7 @@ describe('UserCodeRunner', () => {
208208
it('returns what the promise rejects as an error', async function () {
209209
// Arrange
210210
const fn = async function (): Promise<void> {
211-
return await Promise.reject('error') // eslint-disable-line prefer-promise-reject-errors
211+
throw 'error'
212212
}
213213

214214
// Act

0 commit comments

Comments
 (0)