diff --git a/src/framework/logger.ts b/src/framework/logger.ts index b4e8a9634079..bfa200d1cfc5 100644 --- a/src/framework/logger.ts +++ b/src/framework/logger.ts @@ -5,12 +5,12 @@ import { TestSpecID } from './id.js'; import { makeQueryString } from './url_query.js'; type Status = 'running' | 'pass' | 'warn' | 'fail'; -interface TestLiveResult { +interface LiveTestRunResult { spec: string; - cases: TestCaseLiveResult[]; + cases: LiveTestCaseResult[]; } -export interface TestCaseLiveResult { +export interface LiveTestCaseResult { name: string; params: ParamsSpec | null; status: Status; @@ -19,13 +19,13 @@ export interface TestCaseLiveResult { } export class Logger { - readonly results: TestLiveResult[] = []; + readonly results: LiveTestRunResult[] = []; constructor() {} - record(spec: TestSpecID): [GroupRecorder, TestLiveResult] { - const cases: TestCaseLiveResult[] = []; - const result: TestLiveResult = { spec: makeQueryString(spec), cases }; + record(spec: TestSpecID): [GroupRecorder, LiveTestRunResult] { + const cases: LiveTestCaseResult[] = []; + const result: LiveTestRunResult = { spec: makeQueryString(spec), cases }; this.results.push(result); return [new GroupRecorder(result), result]; } @@ -36,27 +36,27 @@ export class Logger { } export class GroupRecorder { - private test: TestLiveResult; + private test: LiveTestRunResult; - constructor(test: TestLiveResult) { + constructor(test: LiveTestRunResult) { this.test = test; } - record(name: string, params: ParamsSpec | null): [CaseRecorder, TestCaseLiveResult] { - const result: TestCaseLiveResult = { name, params, status: 'running', timems: -1 }; + record(name: string, params: ParamsSpec | null): [CaseRecorder, LiveTestCaseResult] { + const result: LiveTestCaseResult = { name, params, status: 'running', timems: -1 }; this.test.cases.push(result); return [new CaseRecorder(result), result]; } } export class CaseRecorder { - private result: TestCaseLiveResult; + private result: LiveTestCaseResult; private failed = false; private warned = false; private startTime = -1; private logs: string[] = []; - constructor(result: TestCaseLiveResult) { + constructor(result: LiveTestCaseResult) { this.result = result; } diff --git a/src/framework/test_group.ts b/src/framework/test_group.ts index 00124543da06..55459d4499c8 100644 --- a/src/framework/test_group.ts +++ b/src/framework/test_group.ts @@ -1,4 +1,4 @@ -import { CaseRecorder, GroupRecorder, TestCaseLiveResult } from './logger.js'; +import { CaseRecorder, GroupRecorder, LiveTestCaseResult } from './logger.js'; import { ParamsAny, ParamSpecIterable, paramsEquals } from './params/index.js'; import { Fixture } from './fixture.js'; import { allowedTestNameCharacters } from './allowed_characters.js'; @@ -6,7 +6,7 @@ import { TestCaseID } from './id.js'; export interface RunCase { readonly id: TestCaseID; - run(): Promise; + run(): Promise; } export interface RunCaseIterable { @@ -108,7 +108,7 @@ class RunCaseSpecific implements RunCase { this.fn = fn; } - async run(): Promise { + async run(): Promise { const [rec, res] = this.recorder.record(this.id.name, this.id.params); rec.start(); try { diff --git a/src/runtime/cmdline.ts b/src/runtime/cmdline.ts index 0724dacebd10..9caee3e27b65 100644 --- a/src/runtime/cmdline.ts +++ b/src/runtime/cmdline.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import * as process from 'process'; import { TestSpecFile, TestLoader } from '../framework/loader.js'; -import { Logger, TestCaseLiveResult } from '../framework/logger.js'; +import { Logger, LiveTestCaseResult } from '../framework/logger.js'; import { TestSpecID } from '../framework/id.js'; import { makeQueryString } from '../framework/url_query.js'; @@ -48,8 +48,8 @@ for (const a of process.argv.slice(2)) { Array.from(listing, ({ id, spec }) => spec.then((s: TestSpecFile) => ({ id, spec: s }))) ); - const failed: Array<[TestSpecID, TestCaseLiveResult]> = []; - const warned: Array<[TestSpecID, TestCaseLiveResult]> = []; + const failed: Array<[TestSpecID, LiveTestCaseResult]> = []; + const warned: Array<[TestSpecID, LiveTestCaseResult]> = []; // TODO: don't run all tests all at once const running = [];