mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
test(integration): rename app module in test e2e
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('GraphQL - Code-first', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('GraphQL - Guards', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { INestApplication, ValidationPipe } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('GraphQL Pipes', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
|
||||
@@ -18,4 +18,4 @@ import { RecipesModule } from './recipes/recipes.module';
|
||||
}),
|
||||
],
|
||||
})
|
||||
export class ApplicationModule {}
|
||||
export class AppModule {}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('GraphQL', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
|
||||
@@ -13,4 +13,4 @@ import { CatsModule } from './cats/cats.module';
|
||||
}),
|
||||
],
|
||||
})
|
||||
export class ApplicationModule {}
|
||||
export class AppModule {}
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from '@nestjs/platform-fastify';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
const RETURN_VALUE = 'test';
|
||||
const MIDDLEWARE_VALUE = 'middleware';
|
||||
@@ -57,7 +57,7 @@ class TestController {
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
controllers: [TestController],
|
||||
})
|
||||
class TestModule {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
const RETURN_VALUE = 'test';
|
||||
const MIDDLEWARE_VALUE = 'middleware';
|
||||
@@ -48,7 +48,7 @@ class TestController {
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
controllers: [TestController],
|
||||
})
|
||||
class TestModule {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ExpressAdapter } from '@nestjs/platform-express';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as express from 'express';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (express instance)', () => {
|
||||
let server;
|
||||
@@ -11,7 +11,7 @@ describe('Hello world (express instance)', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication(new ExpressAdapter(express()));
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ExpressAdapter } from '@nestjs/platform-express';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as express from 'express';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (express instance with multiple applications)', () => {
|
||||
let server;
|
||||
@@ -11,10 +11,10 @@ describe('Hello world (express instance with multiple applications)', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
const module1 = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
const module2 = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
const adapter = new ExpressAdapter(express());
|
||||
|
||||
@@ -4,14 +4,14 @@ import {
|
||||
} from '@nestjs/platform-fastify';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (fastify adapter)', () => {
|
||||
let app: NestFastifyApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication<NestFastifyApplication>(
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
@Injectable()
|
||||
export class AuthGuard {
|
||||
@@ -20,7 +20,7 @@ export class AuthGuard {
|
||||
|
||||
function createTestModule(guard) {
|
||||
return Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
providers: [
|
||||
{
|
||||
provide: APP_GUARD,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as request from 'supertest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (default adapter)', () => {
|
||||
let server;
|
||||
@@ -9,7 +9,7 @@ describe('Hello world (default adapter)', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Test } from '@nestjs/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
const RETURN_VALUE = 'test';
|
||||
|
||||
@@ -58,7 +58,7 @@ export class HeaderInterceptor {
|
||||
|
||||
function createTestModule(interceptor) {
|
||||
return Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
providers: [
|
||||
{
|
||||
provide: APP_INTERCEPTOR,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (default adapter)', () => {
|
||||
let server;
|
||||
@@ -9,7 +9,7 @@ describe('Hello world (default adapter)', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
import { Response } from 'express';
|
||||
|
||||
const INCLUDED_VALUE = 'test_included';
|
||||
@@ -32,7 +32,7 @@ class TestController {
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
controllers: [TestController],
|
||||
})
|
||||
class TestModule {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from '@nestjs/platform-fastify';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
const INCLUDED_VALUE = 'test_included';
|
||||
const QUERY_VALUE = 'test_query';
|
||||
@@ -58,7 +58,7 @@ class TestQueryController {
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
controllers: [TestController, TestQueryController],
|
||||
})
|
||||
class TestModule {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
const RETURN_VALUE = 'test';
|
||||
const SCOPED_VALUE = 'test_scoped';
|
||||
@@ -27,7 +27,7 @@ class TestController {
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
controllers: [TestController],
|
||||
})
|
||||
class TestModule {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import { RouterModule } from '@nestjs/core';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
const RETURN_VALUE = 'test';
|
||||
const SCOPED_VALUE = 'test_scoped';
|
||||
@@ -27,7 +27,7 @@ class TestController {
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
controllers: [TestController],
|
||||
})
|
||||
class TestModule {
|
||||
|
||||
@@ -6,4 +6,4 @@ import { HostModule } from './host/host.module';
|
||||
@Module({
|
||||
imports: [HelloModule, HostModule, HostArrayModule],
|
||||
})
|
||||
export class ApplicationModule {}
|
||||
export class AppModule {}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import * as request from 'supertest';
|
||||
import { AppController } from '../src/app.controller';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('RPC transport', () => {
|
||||
let server;
|
||||
@@ -12,7 +12,7 @@ describe('RPC transport', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
|
||||
@@ -72,4 +72,4 @@ class ClientOptionService implements ClientsModuleOptionsFactory {
|
||||
],
|
||||
controllers: [AppController],
|
||||
})
|
||||
export class ApplicationModule {}
|
||||
export class AppModule {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { AppModule } from '../src/app.module';
|
||||
|
||||
describe('TypeOrm', () => {
|
||||
let server;
|
||||
@@ -9,7 +9,7 @@ describe('TypeOrm', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
|
||||
@@ -21,4 +21,4 @@ import { PhotoModule } from './photo/photo.module';
|
||||
PhotoModule,
|
||||
],
|
||||
})
|
||||
export class ApplicationModule {}
|
||||
export class AppModule {}
|
||||
|
||||
Reference in New Issue
Block a user