Skip to content

Commit

Permalink
workaround for testing-library#74
Browse files Browse the repository at this point in the history
  • Loading branch information
Horia Ivan committed Jun 9, 2022
1 parent 860106b commit f266471
Show file tree
Hide file tree
Showing 14 changed files with 20,005 additions and 12 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
node_modules/
coverage/
.nyc_output/
dist/
npm-debug.log

dom-testing-library.js
extend.js
extend.d.ts
npm-debug.log
8 changes: 8 additions & 0 deletions dist/extend.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { IScopedQueryUtils } from './typedefs';
declare module 'puppeteer' {
interface Page {
getDocument(): Promise<ElementHandle>;
}
interface ElementHandle extends IScopedQueryUtils {
}
}
51 changes: 51 additions & 0 deletions dist/extend.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/extend.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ElementHandle, Page } from 'puppeteer';
import { IConfigureOptions, IQueryUtils, IScopedQueryUtils } from './typedefs';
declare type ContextFn = (...args: any[]) => ElementHandle;
export declare function getDocument(_page?: Page): Promise<ElementHandle>;
export declare function wait(callback: () => void, { timeout, interval }?: {
timeout?: number;
interval?: number;
}): Promise<{}>;
export declare const waitFor: typeof wait;
export declare function configure(options: Partial<IConfigureOptions>): void;
export declare function getQueriesForElement<T>(object: T, contextFn?: ContextFn): T & IQueryUtils & IScopedQueryUtils;
export declare const within: typeof getQueriesForElement;
export declare const queries: IQueryUtils;
export {};
222 changes: 222 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f266471

Please sign in to comment.