Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to do jest unit test in react

test('render h1 element', () => {
  render(<App />);

  screen.debug();

  expect(screen.getByText('Hello World')).toBeInTheDocument();
});
Source by academind.com #
 
PREVIOUS NEXT
Tagged: #jest #unit #test #react
ADD COMMENT
Topic
Name
3+7 =