SHA: 004cd9273c
This commit is contained in:
parent
0776b954c3
commit
1b2cb1c7b2
2
packages/playwright-test/types/test.d.ts
vendored
2
packages/playwright-test/types/test.d.ts
vendored
|
|
@ -487,7 +487,7 @@ interface TestConfig {
|
|||
* ```
|
||||
*
|
||||
*/
|
||||
webServer?: TestConfigWebServer;
|
||||
webServer?: TestConfigWebServer | TestConfigWebServer[];
|
||||
/**
|
||||
* Configuration for the `expect` assertion library. Learn more about [various timeouts](https://playwright.dev/docs/test-timeouts).
|
||||
*
|
||||
|
|
|
|||
|
|
@ -391,3 +391,29 @@ test('should work with undefined values and base', async ({ runInlineTest }) =>
|
|||
expect(result.exitCode).toBe(0);
|
||||
expect(result.passed).toBe(1);
|
||||
});
|
||||
|
||||
test('should have correct types for the config', async ({ runTSC }) => {
|
||||
const result = await runTSC({
|
||||
'playwright.config.ts': `
|
||||
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||
|
||||
const config: PlaywrightTestConfig = {
|
||||
webServer: [
|
||||
{
|
||||
command: 'echo 123',
|
||||
env: { PORT: '123' },
|
||||
port: 123,
|
||||
},
|
||||
{
|
||||
command: 'echo 123',
|
||||
env: { NODE_ENV: 'test' },
|
||||
port: 8082,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
||||
`
|
||||
});
|
||||
expect(result.exitCode).toBe(0);
|
||||
});
|
||||
|
|
|
|||
2
utils/generate_types/overrides-test.d.ts
vendored
2
utils/generate_types/overrides-test.d.ts
vendored
|
|
@ -58,7 +58,7 @@ type LiteralUnion<T extends U, U = string> = T | (U & { zz_IGNORE_ME?: never });
|
|||
|
||||
interface TestConfig {
|
||||
reporter?: LiteralUnion<'list'|'dot'|'line'|'github'|'json'|'junit'|'null'|'html', string> | ReporterDescription[];
|
||||
webServer?: TestConfigWebServer;
|
||||
webServer?: TestConfigWebServer | TestConfigWebServer[];
|
||||
}
|
||||
|
||||
export interface Config<TestArgs = {}, WorkerArgs = {}> extends TestConfig {
|
||||
|
|
|
|||
Loading…
Reference in a new issue