There are a couple ways of testing the FlamegraphRenderer
component:
In this method you actually render the entire tree.
For that you need to:
- Install
canvas
- Install
jest-canvas-mock
- Add
jest-canvas-mock
to your jest setup (./src/setupTests.js) - Update your jest config to not reset mocks (./jest.config.ts)
An example test is available at ./src/App.spec.jsx
yarn
yarn start