GithubHelp home page GithubHelp logo

Comments (4)

xiifain avatar xiifain commented on July 30, 2024 1

do you have a minimal reproducible repo for it @schw4rzlicht.

Regarding the testing context, you can import the SentryModule like this example service.spec.ts. @booi

describe('Service', () => {

  let service: TestService;

  const config: SentryModuleOptions = {
    dsn: '',
    debug: true,
    environment: 'development',
    logLevels: ['debug'],
  };

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      imports: [SentryModule.forRoot({ ...config })],
      providers: [
        <your providers>
      ]
    }).compile();

    service = module.get<TestService>(TestService);
  });
}

from nestjs-sentry.

booi avatar booi commented on July 30, 2024

@schw4rzlicht I'm having a similar issue and I was wondering if you (or anyone else) has found a solution? I'm having trouble primarily with testing modules that contain the sentry client

from nestjs-sentry.

booi avatar booi commented on July 30, 2024

It seems like @xiifain might know what's going on?

from nestjs-sentry.

booi avatar booi commented on July 30, 2024

@xiifain Thanks for the clarification! I didn't realize I needed to import the sentry module with configuration but it makes sense. I pulled the actual call into it's own file so I could import it in multiple places. Thanks!

from nestjs-sentry.

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.