mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.92k stars 1.19k forks source link

SyntaxError: Illegal break statement #9582

Closed dep closed 1 year ago

dep commented 1 year ago

Duplicates

Latest version

Steps to reproduce 🕹

"@mui/x-data-grid-generator": "6.9.1",
"@mui/x-data-grid-pro": "6.9.1",
"@mui/x-license-pro": "6.0.3",
"jest": "29.6.0",
 "jest-environment-jsdom": "29.6.0",

Steps:

  1. jest test a component that has a DataGridPro component

Current behavior 😯

 FAIL  src/components/App.test.js
  ● renders the App component
    SyntaxError: Illegal break statement
        at Function (<anonymous>)

      10 |
      11 | test("renders the App component", () => {
    > 12 |   render(<App />);
         |         ^
      13 |   expect(
      14 |     screen.queryByText("No data has been loaded.", { exact: false })
      15 |   ).toBeInTheDocument();

      at compile (node_modules/jest-environment-jsdom/node_modules/nwsapi/src/nwsapi.js:760:17)
          at Array.forEach (<anonymous>)
          at Array.forEach (<anonymous>)
      at ../../../../node_modules/@mui/x-data-grid/node/hooks/features/dimensions/useGridDimensions.js:165:31
      at Proxy.computeSizeAndPublishResizeEvent (../../../../node_modules/@mui/x-data-grid/node/hooks/utils/useGridApiMethod.js:22:20)
      at ../../../../node_modules/@mui/x-data-grid/node/components/base/GridBody.js:52:20

Expected behavior 🤔

Tests pass as expected

Context 🔦

This issue emerged without warning over the weekend.

Your environment 🌎

npx @mui/envinfo ``` System: OS: macOS 13.4 Binaries: Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v16.16.0/bin/npm Browsers: Chrome: 114.0.5735.198 Edge: Not Found Firefox: 109.0 Safari: 16.5 npmPackages: @emotion/react: 11.11.0 @emotion/styled: 11.11.0 @mui/base: 5.0.0-beta.5 @mui/core-downloads-tracker: 5.13.4 @mui/icons-material: 5.11.11 @mui/material: 5.13.6 @mui/private-theming: 5.13.1 @mui/styled-engine: 5.13.2 @mui/styles: 5.13.2 @mui/system: 5.13.5 @mui/types: 7.2.4 @mui/utils: 5.13.6 @mui/x-data-grid: 6.0.1 @mui/x-data-grid-generator: 6.9.1 @mui/x-data-grid-premium: 6.9.1 @mui/x-data-grid-pro: 6.9.1 @mui/x-license-pro: 6.0.3 @types/react: 18.2.14 react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.5 ```

Order ID or Support key 💳 (optional)

53240

dep commented 1 year ago

Related: https://github.com/dperini/nwsapi/issues/90

Matt-Tranzact commented 1 year ago

also mentioned in: https://github.com/mui/mui-x/issues/1151#issuecomment-1619252529

dep commented 1 year ago

Resolution https://github.com/dperini/nwsapi/issues/90#issuecomment-1623293796