With our current test situation, we have a commonality between most of our tests. In each one of them, we're importing 'react-testing-library/cleanup-after-each' in our __tests__/calculator.js, and __tests__/auto-scaling-text.js, and __tests__/calculator-display.js.

 

__tests__/auto-scaling-text.js

1 import 'react-testing-library/cleanup-after-each'
2 import React from 'react'
3 import {render} from 'react-testing-library'
4 import AutoScalingText from '../auto-scaling-text'
5 
6 test('renders', () => {
7     const {container} = render(<AutoScalingText />)
8     console.log(container.innerHTML)
9 })
View Code

相关文章:

  • 2021-09-02
  • 2021-11-08
  • 2021-04-05
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2021-07-30
  • 2021-07-02
猜你喜欢
  • 2021-08-19
  • 2022-12-23
  • 2021-12-12
  • 2021-08-06
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案