Skip to content

Commit

Permalink
[@testing-library/react_v9.x.x] refactor: Clean up the types (#3713)
Browse files Browse the repository at this point in the history
* Combine two types to one
* Remove unused import from tests
  • Loading branch information
valscion committed Feb 1, 2020
1 parent b2693c1 commit 0b0eb4a
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
within,
} from '@testing-library/react';
import { describe, it } from 'flow-typed-test';
import { domainToASCII } from 'url';

describe('act', () => {
it('should fail on invalid inputs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
within,
} from '@testing-library/react';
import { describe, it } from 'flow-typed-test';
import { domainToASCII } from 'url';

describe('act', () => {
it('should fail on invalid inputs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,8 @@ declare module '@testing-library/react' {
eventProperties?: TInit
) => boolean;

declare type RenderResult<Queries = GetsAndQueries> = {|
container: HTMLDivElement,
unmount: () => void,
baseElement: HTMLElement,
asFragment: () => DocumentFragment,
debug: (baseElement?: HTMLElement) => void,
rerender: (ui: React$Element<*>) => void,
|} & Queries;
declare type RenderResultWithCustomQueries<CustomQueries> = {
...CustomQueries,
declare type RenderResult<Queries = GetsAndQueries> = {
...Queries,
container: HTMLDivElement,
unmount: () => void,
baseElement: HTMLElement,
Expand Down Expand Up @@ -160,7 +152,7 @@ declare module '@testing-library/react' {
>(
ui: React.ReactElement<any>,
options: RenderOptionsWithCustomQueries<CustomQueries>
): RenderResultWithCustomQueries<CustomQueries>;
): RenderResult<CustomQueries>;

declare export var act: ReactDOMTestUtilsAct;
declare export function cleanup(): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
within,
} from '@testing-library/react';
import { describe, it } from 'flow-typed-test';
import { domainToASCII } from 'url';

describe('act', () => {
it('should fail on invalid inputs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import React from 'react';
import { render, Simulate, wait, fireEvent, renderIntoDocument, cleanup, waitForElement } from 'react-testing-library';
import { describe, it } from 'flow-typed-test';
import { domainToASCII } from 'url';

describe('wait', () => {
it('should fail on invalid inputs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import React from 'react';
import { render, Simulate, wait, fireEvent, renderIntoDocument, cleanup, waitForElement } from 'react-testing-library';
import { describe, it } from 'flow-typed-test';
import { domainToASCII } from 'url';

describe('wait', () => {
it('should fail on invalid inputs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
within,
} from 'react-testing-library';
import { describe, it } from 'flow-typed-test';
import { domainToASCII } from 'url';

describe('wait', () => {
it('should fail on invalid inputs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
within,
} from 'react-testing-library';
import { describe, it } from 'flow-typed-test';
import { domainToASCII } from 'url';

describe('wait', () => {
it('should fail on invalid inputs', () => {
Expand Down

0 comments on commit 0b0eb4a

Please sign in to comment.