Closed
Description
dom-testing-library
version: 2.4.0react
version: 16.3.2
Relevant code or config:
import "dom-testing-library/extend-expect"
import React from "react"
import { render } from "react-testing-library"
const App = () => "Hello World!"
test("App renders without crashing", async () => {
const { queryByText } = render(<App />)
expect(queryByText("Hello World!")).toBeInTheDOM()
})
What you did:
I ran the test.
What happened:
It returned an error:
Cannot read property 'match' of null
TypeError: Cannot read property 'match' of null
at module.exports.str (https://j4rkx7jmlv.codesandbox.io/node_modules/strip-indent/index.js:3:20)
Reproduction:
https://codesandbox.io/s/j4rkx7jmlv
Problem description:
I expect queryByText()
to work with components that return a string.
Suggested solution:
Improve queryByText()
so it supports components that return a string.
Metadata
Metadata
Assignees
Labels
No labels