I have a react app with animation rendered with PIXI.js and @inlet/react-pixi.
When running tests with Jest, I get errors:
Error: Uncaught [TypeError: Cannot read properties of null (reading 'stage')]
● run Homepage tests › is Homepage rendered
WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.
5 | describe('run Homepage tests', () => {
6 | test('is Homepage rendered', () => {
> 7 | render(
| ^
8 | <MockedProvider>
9 | <HomePage />
10 | </MockedProvider>`
How should the pixi.js-legacy be implemented as the fallback for tests?
"@inlet/react-pixi": "^6.8.0",
"pixi.js": "^6.4.2",
"jest-canvas-mock": "^2.4.0",
UPD:
Mocking pixi.js with pixi.js-legacy I got this error:
However, I tried to import pixi.js-legacy:
import 'pixi.js-legacy';
And got the same kind of error:
It seems that there is some problem with importing 'pixi.js-legacy'.
What could go wrong with it?
Has anybody ever seen an example of Jest or other framework tests that works?

