test(integration): rename app module in test e2e

This commit is contained in:
Tony133
2022-05-24 21:28:34 +02:00
parent 7b112ddb30
commit c9e619e74a
24 changed files with 44 additions and 44 deletions

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -18,4 +18,4 @@ import { RecipesModule } from './recipes/recipes.module';
}),
],
})
export class ApplicationModule {}
export class AppModule {}

View File

@@ -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();

View File

@@ -13,4 +13,4 @@ import { CatsModule } from './cats/cats.module';
}),
],
})
export class ApplicationModule {}
export class AppModule {}

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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()));

View File

@@ -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());

View File

@@ -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>(

View File

@@ -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,

View File

@@ -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();

View File

@@ -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,

View File

@@ -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();

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -6,4 +6,4 @@ import { HostModule } from './host/host.module';
@Module({
imports: [HelloModule, HostModule, HostArrayModule],
})
export class ApplicationModule {}
export class AppModule {}

View File

@@ -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();

View File

@@ -72,4 +72,4 @@ class ClientOptionService implements ClientsModuleOptionsFactory {
],
controllers: [AppController],
})
export class ApplicationModule {}
export class AppModule {}

View File

@@ -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();

View File

@@ -21,4 +21,4 @@ import { PhotoModule } from './photo/photo.module';
PhotoModule,
],
})
export class ApplicationModule {}
export class AppModule {}