mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
28 lines
701 B
TypeScript
28 lines
701 B
TypeScript
import { INestApplication } from '@nestjs/common';
|
|
import { Test } from '@nestjs/testing';
|
|
import * as chai from 'chai';
|
|
import { expect } from 'chai';
|
|
import { AppModule } from '../src/app.module';
|
|
import chaiAsPromised = require('chai-as-promised');
|
|
chai.use(chaiAsPromised);
|
|
|
|
describe('Lazy imports', () => {
|
|
let app: INestApplication;
|
|
|
|
beforeEach(async () => {
|
|
const module = await Test.createTestingModule({
|
|
imports: [AppModule],
|
|
}).compile();
|
|
|
|
app = module.createNestApplication();
|
|
});
|
|
|
|
it(`should allow imports of global modules`, async () => {
|
|
await expect(app.init()).to.eventually.be.fulfilled;
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await app.close();
|
|
});
|
|
});
|