Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Jest tests broken after introducing plotly.js #17

Closed
ansjcy opened this issue Sep 11, 2024 · 2 comments
Closed

[BUG] Jest tests broken after introducing plotly.js #17

ansjcy opened this issue Sep 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ansjcy
Copy link
Member

ansjcy commented Sep 11, 2024

What is the bug?

Jest tests are failing with the below error after plotly.js is introduced as a dependency.

 FAIL  public/components/app.test.tsx
  ● Test suite failed to run

    TypeError: URL is not a constructor

       5 |
       6 | import React, { useEffect } from 'react';
    >  7 | import Plotly from 'plotly.js-dist';
         | ^
       8 | import {
       9 |   EuiButton,
      10 |   EuiCodeBlock,

      at Object.5955 (node_modules/plotly.js-dist/plotly.js:122829:37)
      at __webpack_require__ (node_modules/plotly.js-dist/plotly.js:278335:42)
      at Module.96144 (node_modules/plotly.js-dist/plotly.js:223433:97)
      at __webpack_require__ (node_modules/plotly.js-dist/plotly.js:278335:42)
      at registerTraceModule (node_modules/plotly.js-dist/plotly.js:65893:5)
      at Object.register (node_modules/plotly.js-dist/plotly.js:65716:9)
      at Object.20260 (node_modules/plotly.js-dist/plotly.js:364:8)
      at __webpack_require__ (node_modules/plotly.js-dist/plotly.js:278335:42)
      at node_modules/plotly.js-dist/plotly.js:278433:37
      at node_modules/plotly.js-dist/plotly.js:278436:12
      at webpackUniversalModuleDefinition (node_modules/plotly.js-dist/plotly.js:9:20)
      at Object.<anonymous> (node_modules/plotly.js-dist/plotly.js:16:3)
      at Object.<anonymous> (public/pages/QueryDetails/QueryDetails.tsx:7:1)
      at Object.<anonymous> (public/pages/TopNQueries/TopNQueries.tsx:12:1)
      at Object.<anonymous> (public/components/app.tsx:8:1)
      at Object.<anonymous> (public/components/app.test.tsx:11:1)
      at TestScheduler.scheduleTests (../../node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (../../node_modules/@jest/core/build/runJest.js:404:19)
      at _run10000 (../../node_modules/@jest/core/build/cli/index.js:320:7)
      at runCLI (../../node_modules/@jest/core/build/cli/index.js:173:3)

How can one reproduce the bug?

Run jest tests with yarn test:jest

What is the expected behavior?

No exceptions should be thrown when running the jest tests.

What is your host/environment?

macos

Do you have any screenshots?

N/A

Do you have any additional context?

N/A

@ansjcy ansjcy added bug Something isn't working untriaged labels Sep 11, 2024
@ansjcy ansjcy self-assigned this Sep 11, 2024
@ansjcy
Copy link
Member Author

ansjcy commented Sep 11, 2024

Triage - We need to fix this for 2.18.

@ansjcy
Copy link
Member Author

ansjcy commented Sep 11, 2024

This is fixed by #18

@ansjcy ansjcy closed this as completed Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant