Giter Site home page Giter Site logo

Comments (7)

pichlermarc avatar pichlermarc commented on June 30, 2024

Do you call MeterProvider.shutdown() when the tests are done?
Which platform are you running on?

from opentelemetry-js.

iemjitendra avatar iemjitendra commented on June 30, 2024

@pichlermarc Do you call MeterProvider.shutdown() when the tests are done? >>> NO
Which platform are you running on? >>> i am running on my localhost(macbook). i run yarn test on my project after integrating metrics sdk. As i still did not write any test cases for metrics then why my project existing test suite is braking by just integrating metrics api.
I tried this as well, did not work for me -> #3723 (comment)

from opentelemetry-js.

iemjitendra avatar iemjitendra commented on June 30, 2024

@pichlermarc can you please help in identify this issue. As i could not make out if this issue coming from metrics library or is there something wrong i am doing it.

from opentelemetry-js.

pichlermarc avatar pichlermarc commented on June 30, 2024

The reason is that we currently don't set the browser overrides in a way that jest can deal with them, it only works for webpack and some other bundlers.

See

So it's not something you're doing wrong, but testing in jest like this is a case we currently don't support. That being said #4543 is now up-for-grabs in case someone has cycles to work on it.

from opentelemetry-js.

iemjitendra avatar iemjitendra commented on June 30, 2024

thank you so much for help @pichlermarc
this issue is resolved by mocking metircs library in jest setupTest file, which is root file of jest
jest.mock('@opentelemetry/sdk-metrics');

BTW in the future upcoming versions, can this error go away without mocking metrics library.

from opentelemetry-js.

dyladan avatar dyladan commented on June 30, 2024

I believe this can be closed in favor of #4543

from opentelemetry-js.

pichlermarc avatar pichlermarc commented on June 30, 2024

BTW in the future upcoming versions, can this error go away without mocking metrics library.

@iemjitendra, yes we hope to address this with #4543, which should take care of that. I'll close this issue as duplicate for now as the other one is more explicit about what we need to do.

from opentelemetry-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.