mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
1
types/testing-library__react/index.d.ts
vendored
1
types/testing-library__react/index.d.ts
vendored
@@ -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
|
||||
|
||||
|
||||
1
types/testing-library__react/pure.d.ts
vendored
Normal file
1
types/testing-library__react/pure.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './';
|
||||
@@ -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 };
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user