set tab width to 4

main
Inga 🏳‍🌈 5 months ago
parent 909720a11d
commit 1e92edeae4
  1. 1
      .prettierrc
  2. 24
      src/app.controller.spec.ts
  3. 10
      src/app.controller.ts
  4. 6
      src/app.module.ts
  5. 6
      src/app.service.ts
  6. 4
      src/main.ts
  7. 28
      test/app.e2e-spec.ts

@ -1,4 +1,5 @@
{ {
"tabWidth": 4,
"singleQuote": true, "singleQuote": true,
"trailingComma": "all" "trailingComma": "all"
} }

@ -3,20 +3,20 @@ import { AppController } from './app.controller';
import { AppService } from './app.service'; import { AppService } from './app.service';
describe('AppController', () => { describe('AppController', () => {
let appController: AppController; let appController: AppController;
beforeEach(async () => { beforeEach(async () => {
const app: TestingModule = await Test.createTestingModule({ const app: TestingModule = await Test.createTestingModule({
controllers: [AppController], controllers: [AppController],
providers: [AppService], providers: [AppService],
}).compile(); }).compile();
appController = app.get<AppController>(AppController); appController = app.get<AppController>(AppController);
}); });
describe('root', () => { describe('root', () => {
it('should return "Hello World!"', () => { it('should return "Hello World!"', () => {
expect(appController.getHello()).toBe('Hello World!'); expect(appController.getHello()).toBe('Hello World!');
});
}); });
});
}); });

@ -3,10 +3,10 @@ import { AppService } from './app.service';
@Controller() @Controller()
export class AppController { export class AppController {
constructor(private readonly appService: AppService) {} constructor(private readonly appService: AppService) {}
@Get() @Get()
getHello(): string { getHello(): string {
return this.appService.getHello(); return this.appService.getHello();
} }
} }

@ -3,9 +3,9 @@ import { AppController } from './app.controller';
import { AppService } from './app.service'; import { AppService } from './app.service';
@Module({ @Module({
imports: [], imports: [],
controllers: [AppController], controllers: [AppController],
providers: [AppService], providers: [AppService],
}) })
// eslint-disable-next-line @typescript-eslint/no-extraneous-class // eslint-disable-next-line @typescript-eslint/no-extraneous-class
export class AppModule {} export class AppModule {}

@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
@Injectable() @Injectable()
export class AppService { export class AppService {
getHello(): string { getHello(): string {
return 'Hello World!'; return 'Hello World!';
} }
} }

@ -2,7 +2,7 @@ import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module'; import { AppModule } from './app.module';
async function bootstrap() { async function bootstrap() {
const app = await NestFactory.create(AppModule); const app = await NestFactory.create(AppModule);
await app.listen(3000); await app.listen(3000);
} }
void bootstrap(); void bootstrap();

@ -4,21 +4,21 @@ import request from 'supertest';
import { AppModule } from './../src/app.module'; import { AppModule } from './../src/app.module';
describe('AppController (e2e)', () => { describe('AppController (e2e)', () => {
let app: INestApplication; let app: INestApplication;
beforeEach(async () => { beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({ const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule], imports: [AppModule],
}).compile(); }).compile();
app = moduleFixture.createNestApplication(); app = moduleFixture.createNestApplication();
await app.init(); await app.init();
}); });
it('/ (GET)', () => { it('/ (GET)', () => {
return request(app.getHttpServer()) return request(app.getHttpServer())
.get('/') .get('/')
.expect(200) .expect(200)
.expect('Hello World!'); .expect('Hello World!');
}); });
}); });

Loading…
Cancel
Save