Skip to content

Commit

Permalink
chore(tests): use public types for the tests (#1600)
Browse files Browse the repository at this point in the history
Using the public types in our test will help us dogfood them. Typechecking isn't enabled yet, but I am working on it.
  • Loading branch information
JoelEinbinder authored Mar 31, 2020
1 parent 2402aad commit 34610f2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ interface TestSetup<STATE> {
MAC: boolean;
LINUX: boolean;
WIN: boolean;
playwright: import('../src/server/browserType').BrowserType<import('../src/browser').Browser>;
playwright: typeof import('../index');
browserType: import('../index').BrowserType<import('../index').Browser>;
selectors: import('../src/selectors').Selectors;
expect<T>(value: T): Expect<T>;
defaultBrowserOptions: import('../src/server/browserType').LaunchOptions;
Expand All @@ -64,16 +65,16 @@ type TestState = {
};

type BrowserState = TestState & {
browser: import('../src/browser').Browser;
browserServer: import('../src/server/browserServer').BrowserServer;
browser: import('../index').Browser;
browserServer: import('../index').BrowserServer;
};

type PageState = BrowserState & {
context: import('../src/browserContext').BrowserContext;
page: import('../src/page').Page;
context: import('../index').BrowserContext;
page: import('../index').Page;
};
type ChromiumPageState = PageState & {
browser: import('../src/chromium/crBrowser').CRBrowser;
browser: import('../index').ChromiumBrowser;
};
type TestSuite = (setup: TestSetup<TestState>) => void;
type BrowserTestSuite = (setup: TestSetup<BrowserState>) => void;
Expand Down

0 comments on commit 34610f2

Please sign in to comment.