Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nestjs run tests

beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      providers: [ApiService],
      imports: [HttpModule],
    }).compile();
    // getting service modue from main module
    service = module.get<ApiService>(ApiService);
  });
  // now checking if service is available 
  it('ApiService - should be defined', () => {
    expect(service).toBeDefined();
  });
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #nestjs #run #tests
ADD COMMENT
Topic
Name
2+2 =