Retrait des points-virgules finaux
This commit is contained in:
@ -21,5 +21,6 @@ module.exports = {
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/semi': 'never',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -1,26 +1,26 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
async function main() {
|
||||
const emmy = await prisma.user.upsert({
|
||||
where: { id: 1 },
|
||||
update: { name: 'Emmy' },
|
||||
create: { name: 'Emmy' },
|
||||
});
|
||||
})
|
||||
const tamina = await prisma.user.upsert({
|
||||
where: { id: 2 },
|
||||
update: { name: 'Tamina' },
|
||||
create: { name: 'Tamina' },
|
||||
});
|
||||
console.log({ emmy, tamina });
|
||||
})
|
||||
console.log({ emmy, tamina })
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
console.error(e)
|
||||
process.exit(1)
|
||||
})
|
||||
.finally(async () => {
|
||||
await prisma.$disconnect();
|
||||
});
|
||||
await prisma.$disconnect()
|
||||
})
|
||||
|
@ -1,22 +1,22 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { Test, TestingModule } from '@nestjs/testing'
|
||||
import { AppController } from './app.controller'
|
||||
import { AppService } from './app.service'
|
||||
|
||||
describe('AppController', () => {
|
||||
let appController: AppController;
|
||||
let appController: AppController
|
||||
|
||||
beforeEach(async () => {
|
||||
const app: TestingModule = await Test.createTestingModule({
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
}).compile();
|
||||
}).compile()
|
||||
|
||||
appController = app.get<AppController>(AppController);
|
||||
});
|
||||
appController = app.get<AppController>(AppController)
|
||||
})
|
||||
|
||||
describe('root', () => {
|
||||
it('should return "Hello World!"', () => {
|
||||
expect(appController.getHello()).toBe('Hello World!');
|
||||
});
|
||||
});
|
||||
});
|
||||
expect(appController.getHello()).toBe('Hello World!')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
import { Controller, Get } from '@nestjs/common'
|
||||
import { AppService } from './app.service'
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
@ -7,6 +7,6 @@ export class AppController {
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return this.appService.getHello();
|
||||
return this.appService.getHello()
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { Module } from '@nestjs/common'
|
||||
import { AppController } from './app.controller'
|
||||
import { AppService } from './app.service'
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable } from '@nestjs/common'
|
||||
|
||||
@Injectable()
|
||||
export class AppService {
|
||||
getHello(): string {
|
||||
return 'Hello World!';
|
||||
return 'Hello World!'
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
import { NestFactory } from '@nestjs/core'
|
||||
import { AppModule } from './app.module'
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
const app = await NestFactory.create(AppModule)
|
||||
await app.listen(process.env.PORT ?? 3000)
|
||||
}
|
||||
bootstrap();
|
||||
bootstrap()
|
||||
|
@ -1,24 +1,24 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import * as request from 'supertest';
|
||||
import { AppModule } from './../src/app.module';
|
||||
import { Test, TestingModule } from '@nestjs/testing'
|
||||
import { INestApplication } from '@nestjs/common'
|
||||
import * as request from 'supertest'
|
||||
import { AppModule } from './../src/app.module'
|
||||
|
||||
describe('AppController (e2e)', () => {
|
||||
let app: INestApplication;
|
||||
let app: INestApplication
|
||||
|
||||
beforeEach(async () => {
|
||||
const moduleFixture: TestingModule = await Test.createTestingModule({
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
}).compile()
|
||||
|
||||
app = moduleFixture.createNestApplication();
|
||||
await app.init();
|
||||
});
|
||||
app = moduleFixture.createNestApplication()
|
||||
await app.init()
|
||||
})
|
||||
|
||||
it('/ (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/')
|
||||
.expect(200)
|
||||
.expect('Hello World!');
|
||||
});
|
||||
});
|
||||
.expect('Hello World!')
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user