feat: update testing-library__react (#37705)

Add pure module types
This commit is contained in:
Ifiok Jr
2019-08-19 23:05:51 +01:00
committed by Sheetal Nandi
parent bbe8520b9e
commit aa5b9deff7
4 changed files with 22 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
// Kent C Dodds <https://github.com/kentcdodds>
// Sebastian Silbermann <https://github.com/eps1lon>
// Weyert de Boer <https://github.com/weyert>
// Ifiok Jr. <https://github.com/ifiokjr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0

View File

@@ -0,0 +1 @@
export * from './';

View File

@@ -1,5 +1,6 @@
import * as React from 'react';
import { render, fireEvent } from '@testing-library/react';
import * as pure from '@testing-library/react/pure';
async function testRender() {
const page = render(<div />);
@@ -18,6 +19,23 @@ async function testRender() {
const { container, rerender, debug } = page;
}
async function testPureRender() {
const page = pure.render(<div />);
// single queries
page.getByText('foo');
page.queryByText('foo');
await page.findByText('foo');
// multiple queries
page.getAllByText('bar');
page.queryAllByText('bar');
await page.findAllByText('bar');
// helpers
const { container, rerender, debug } = page;
}
async function testRenderOptions() {
const container = document.createElement('div');
const options = { container };

View File

@@ -15,8 +15,9 @@
"forceConsistentCasingInFileNames": true,
"paths": {
"@testing-library/react": ["testing-library__react"],
"@testing-library/react/*": ["testing-library__react/*"],
"@testing-library/dom": ["testing-library__dom"]
}
},
"files": ["index.d.ts", "testing-library__react-tests.tsx"]
"files": ["index.d.ts", "pure.d.ts", "testing-library__react-tests.tsx"]
}