Skip to content

Conversation

mdjastrzebski
Copy link
Member

Summary

I have compacted our TS typedefs tests, so that queries with same return type are grouped together as an array, which makes the code more compact and easier to spot missing/wrong tests.


const waitForFlush: Promise<any> = flushMicrotasksQueue();
const waitGetAllBy: Promise<ReactTestInstance[]>[] = [
waitFor<ReactTestInstance[]>(() => tree.getAllByA11yLabel('label')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waitFor can work with any throwable function, maybe we can showcase that and get rid of tree.getAllBy examples?

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please!

@thymikee thymikee merged commit 3ef0064 into next May 20, 2020
@thymikee thymikee deleted the feature/cleanup-ts-tests branch May 20, 2020 08:37
thymikee pushed a commit that referenced this pull request May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants