fix(test-runner): fix, linter and formatting
This commit is contained in:
parent
a457d169eb
commit
44fafba3f2
|
|
@ -223,7 +223,7 @@ async function filterTestGroups(config: FullConfigInternal, testGroups: TestGrou
|
||||||
const result = filter.filterTestGroups.call(filterThis, filteredTestGroups);
|
const result = filter.filterTestGroups.call(filterThis, filteredTestGroups);
|
||||||
filteredTestGroups = result instanceof Promise ? await result : result;
|
filteredTestGroups = result instanceof Promise ? await result : result;
|
||||||
} else if ('filterTests' in filter) {
|
} else if ('filterTests' in filter) {
|
||||||
const result = filter.filterTests.call(filterThis, filteredTestGroups.flatMap(group => group.tests), config.config);
|
const result = filter.filterTests.call(filterThis, filteredTestGroups.flatMap(group => group.tests));
|
||||||
const filteredTests = result instanceof Promise ? await result : result;
|
const filteredTests = result instanceof Promise ? await result : result;
|
||||||
if (!Array.isArray(filteredTests))
|
if (!Array.isArray(filteredTests))
|
||||||
throw new Error('Invalid filter result: tests should be an array');
|
throw new Error('Invalid filter result: tests should be an array');
|
||||||
|
|
|
||||||
22
packages/playwright/types/test.d.ts
vendored
22
packages/playwright/types/test.d.ts
vendored
|
|
@ -1904,10 +1904,24 @@ export type TestDetails = {
|
||||||
annotation?: TestDetailsAnnotation | TestDetailsAnnotation[];
|
annotation?: TestDetailsAnnotation | TestDetailsAnnotation[];
|
||||||
}
|
}
|
||||||
|
|
||||||
type TestFilterThis = { config: FullConfig };
|
type TestFilterThis = {
|
||||||
type TestFilterFunction = (this: TestFilterThis, test: TestCase) => boolean;
|
config: FullConfig
|
||||||
type TestsFilter = { filterTests(this: TestFilterThis, tests: TestCase[]): Promise<TestCase[]> | TestCase[] };
|
}
|
||||||
type TestGroupsFilter = { filterTestGroups(this: TestFilterThis, testGroups: { tests: TestCase[] }[]): Promise<{ tests: TestCase[] }[]> | { tests: TestCase[] }[] };
|
|
||||||
|
export type TestFilterFunction = (this: TestFilterThis, test: TestCase) => boolean;
|
||||||
|
|
||||||
|
export type TestsFilter = {
|
||||||
|
filterTests(this: TestFilterThis, tests: TestCase[]): Promise<TestCase[]> | TestCase[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TestGroup = {
|
||||||
|
tests: TestCase[]
|
||||||
|
};
|
||||||
|
|
||||||
|
export type TestGroupsFilter = {
|
||||||
|
filterTestGroups(this: TestFilterThis, testGroups: TestGroup[]): Promise<TestGroup[]> | TestGroup[]
|
||||||
|
}
|
||||||
|
|
||||||
export type TestFilter = TestFilterFunction | TestsFilter | TestGroupsFilter;
|
export type TestFilter = TestFilterFunction | TestsFilter | TestGroupsFilter;
|
||||||
|
|
||||||
interface SuiteFunction {
|
interface SuiteFunction {
|
||||||
|
|
|
||||||
22
utils/generate_types/overrides-test.d.ts
vendored
22
utils/generate_types/overrides-test.d.ts
vendored
|
|
@ -77,10 +77,24 @@ export type TestDetails = {
|
||||||
annotation?: TestDetailsAnnotation | TestDetailsAnnotation[];
|
annotation?: TestDetailsAnnotation | TestDetailsAnnotation[];
|
||||||
}
|
}
|
||||||
|
|
||||||
type TestFilterThis = { config: FullConfig };
|
type TestFilterThis = {
|
||||||
type TestFilterFunction = (this: TestFilterThis, test: TestCase) => boolean;
|
config: FullConfig
|
||||||
type TestsFilter = { filterTests(this: TestFilterThis, tests: TestCase[]): Promise<TestCase[]> | TestCase[] };
|
}
|
||||||
type TestGroupsFilter = { filterTestGroups(this: TestFilterThis, testGroups: { tests: TestCase[] }[]): Promise<{ tests: TestCase[] }[]> | { tests: TestCase[] }[] };
|
|
||||||
|
export type TestFilterFunction = (this: TestFilterThis, test: TestCase) => boolean;
|
||||||
|
|
||||||
|
export type TestsFilter = {
|
||||||
|
filterTests(this: TestFilterThis, tests: TestCase[]): Promise<TestCase[]> | TestCase[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TestGroup = {
|
||||||
|
tests: TestCase[]
|
||||||
|
};
|
||||||
|
|
||||||
|
export type TestGroupsFilter = {
|
||||||
|
filterTestGroups(this: TestFilterThis, testGroups: TestGroup[]): Promise<TestGroup[]> | TestGroup[]
|
||||||
|
}
|
||||||
|
|
||||||
export type TestFilter = TestFilterFunction | TestsFilter | TestGroupsFilter;
|
export type TestFilter = TestFilterFunction | TestsFilter | TestGroupsFilter;
|
||||||
|
|
||||||
interface SuiteFunction {
|
interface SuiteFunction {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue