sberdevices/plasma

plasma-ui: update `jest`

Yeti-or opened this issue · 1 comments

npm install --save-dev jest@27.1.0
npm test

> BABEL_ENV=cjs jest

 FAIL  src/components/Button/Button.test.tsx
  ● Button component › renders button html element

    The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
    Consider using the "jsdom" test environment.

    ReferenceError: document is not defined

       9 |         const testText = 'Hello Plasma';
      10 |
    > 11 |         render(<Button text={testText} />);
         |         ^
      12 |         expect(screen.queryByText(testText)).not.toBeNull();
      13 |     });
      14 | });

      at render (node_modules/@testing-library/react/dist/pure.js:83:5)
      at Object.<anonymous> (src/components/Button/Button.test.tsx:11:9)
  • @types/jest@27.0.1 тоже обновить