Skip to content

Commit 2554452

Browse files
committed
Fix linter
1 parent 51b5423 commit 2554452

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ async function bootstrap() {
2727
await app.listen(port);
2828
}
2929

30-
bootstrap();
30+
void bootstrap();

test/users.e2e-spec.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Test, TestingModule } from '@nestjs/testing';
22
import { INestApplication, ValidationPipe } from '@nestjs/common';
33
import request from 'supertest';
4-
import { AppModule } from '../src/app.module';
4+
import { AppModule } from 'src/app.module';
5+
import { User } from 'src/users/entities/user.entity';
56

67
describe('UsersModule (e2e)', () => {
78
let app: INestApplication;
@@ -26,27 +27,31 @@ describe('UsersModule (e2e)', () => {
2627
email: 'simone@example.com',
2728
};
2829

30+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
2931
const res = await request(app.getHttpServer())
3032
.post('/api/v1/users')
3133
.send(userDto)
3234
.expect(201);
3335

34-
expect(res.body).toEqual({
36+
const user = res.body as User;
37+
expect(user).toEqual({
3538
id: expect.any(Number),
3639
name: userDto.name,
3740
email: userDto.email,
3841
});
3942
});
4043

4144
it('/api/v1/users (GET) should return all users', async () => {
45+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
4246
const res = await request(app.getHttpServer())
4347
.get('/api/v1/users')
4448
.expect(200);
4549

46-
expect(Array.isArray(res.body)).toBe(true);
47-
expect(res.body[0]).toHaveProperty('id');
48-
expect(res.body[0]).toHaveProperty('name');
49-
expect(res.body[0]).toHaveProperty('email');
50+
const users = res.body as User[];
51+
expect(Array.isArray(users)).toBe(true);
52+
expect(users[0]).toHaveProperty('id');
53+
expect(users[0]).toHaveProperty('name');
54+
expect(users[0]).toHaveProperty('email');
5055
});
5156

5257
afterAll(async () => {

0 commit comments

Comments
 (0)