Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
baseballyama committed Sep 24, 2021
1 parent 6536478 commit c218eb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/kit/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function duplicate(test_fn, config, is_build) {
* @param {import('playwright-chromium').Page} page
* @param {string} selector
* @param {boolean} contains_iframe
* @returns {Array<import('playwright-chromium').ElementHandle<SVGElement | HTMLElement>>}
* @returns {Promise<Array<import('playwright-chromium').ElementHandle<SVGElement | HTMLElement>>>}
*/
async function get_elements(page, selector, contains_iframe = false) {
const until = new Date().getTime() + 2000;
Expand Down Expand Up @@ -209,7 +209,8 @@ function duplicate(test_fn, config, is_build) {
page: context.pages.nojs,
clicknav: (selector) => context.pages.nojs.click(selector),
back: () => context.pages.nojs.goBack().then(() => void 0),
get_elements: (selector, is_iframe = false) => get_elements(context.pages.nojs, selector, is_iframe),
get_elements: (selector, is_iframe = false) =>
get_elements(context.pages.nojs, selector, is_iframe),
// @ts-expect-error
response,
js: false
Expand Down Expand Up @@ -275,7 +276,8 @@ function duplicate(test_fn, config, is_build) {
await context.pages.js.goBack();
await context.pages.js.evaluate(() => window.navigated);
},
get_elements: (selector, is_iframe = false) => get_elements(context.pages.js, selector, is_iframe),
get_elements: (selector, is_iframe = false) =>
get_elements(context.pages.js, selector, is_iframe),
js: true,
// @ts-expect-error
response
Expand Down
5 changes: 4 additions & 1 deletion packages/kit/test/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export interface TestContext {
response: PlaywrightResponse;
clicknav(selector: string): Promise<void>;
back(): Promise<void>;
get_elements(selector: string, contains_iframe?: boolean): Promise<Array<ElementHandle<SVGElement | HTMLElement>>>;
get_elements(
selector: string,
contains_iframe?: boolean
): Promise<Array<ElementHandle<SVGElement | HTMLElement>>>;
fetch(url: RequestInfo, opts?: RequestInit): Promise<NodeFetchResponse>;
capture_requests(fn: () => Promise<void>): Promise<string[]>;
errors(): string;
Expand Down

0 comments on commit c218eb6

Please sign in to comment.