Skip to content

Use new screen export #14

@oliverjam

Description

@oliverjam

As of today RTL exports screen, an object of all the query functions pre-bound to document.body. This means you don't have to use the return value of render anymore, which is a little less confusing for beginners.

import { render, screen } from '@testing-library/react'

test('example', () => {
  render(<Thing />);
  expect(screen.queryText(/not here/i)).toBeNull();
})

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions