Skip to content

Commit 24b32e3

Browse files
refactor(): run format script (prettier)
1 parent 4565a9f commit 24b32e3

7 files changed

Lines changed: 24 additions & 15 deletions

File tree

sample/19-auth-jwt/e2e/app/app.e2e-spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { INestApplication } from '@nestjs/common';
2-
import { Test} from '@nestjs/testing';
2+
import { Test } from '@nestjs/testing';
33
import * as request from 'supertest';
44
import { AppModule } from '../../src/app.module';
55

@@ -20,16 +20,16 @@ describe('E2E JWT Sample', () => {
2020
.post('/auth/login')
2121
.send({ username: 'john', password: 'changeme' })
2222
.expect(201);
23-
23+
2424
const token = loginReq.body.access_token;
2525
return request(app.getHttpServer())
2626
.get('/profile')
2727
.set('Authorization', 'Bearer ' + token)
2828
.expect(200)
29-
.expect({ userId: 1, username: 'john'})
29+
.expect({ userId: 1, username: 'john' });
3030
});
3131

32-
afterAll(async() => {
32+
afterAll(async () => {
3333
await app.close();
3434
});
3535
});

sample/19-auth-jwt/src/users/users.service.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ describe('UsersService', () => {
2525
},
2626
);
2727
});
28-

sample/28-file-upload/e2e/app/app.e2e-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { AppModule } from '../../src/app.module';
88
describe('E2E FileTest', () => {
99
let app: INestApplication;
1010

11-
beforeAll(async() => {
11+
beforeAll(async () => {
1212
const moduleRef = await Test.createTestingModule({
1313
imports: [AppModule],
1414
}).compile();
@@ -27,7 +27,7 @@ describe('E2E FileTest', () => {
2727
name: 'test',
2828
},
2929
file: readFileSync('./package.json').toString(),
30-
})
30+
});
3131
});
3232

3333
afterAll(async () => {

sample/28-file-upload/src/app.controller.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { Body, Controller, Get, Post, UploadedFile, UseInterceptors } from '@nestjs/common';
1+
import {
2+
Body,
3+
Controller,
4+
Get,
5+
Post,
6+
UploadedFile,
7+
UseInterceptors,
8+
} from '@nestjs/common';
29
import { FileInterceptor } from '@nestjs/platform-express';
310
import { Express } from 'express';
411
import { AppService } from './app.service';
@@ -15,10 +22,13 @@ export class AppController {
1522

1623
@UseInterceptors(FileInterceptor('file'))
1724
@Post('file')
18-
uploadFile(@Body() body: SampleDto, @UploadedFile() file: Express.Multer.File) {
19-
return {
25+
uploadFile(
26+
@Body() body: SampleDto,
27+
@UploadedFile() file: Express.Multer.File,
28+
) {
29+
return {
2030
body,
2131
file: file.buffer.toString(),
22-
}
32+
};
2333
}
24-
}
34+
}

sample/28-file-upload/src/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { AppService } from './app.service';
44

55
@Module({
66
controllers: [AppController],
7-
providers: [AppService]
7+
providers: [AppService],
88
})
99
export class AppModule {}

sample/28-file-upload/src/app.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ export class AppService {
55
getHello() {
66
return { hello: 'world' };
77
}
8-
}
8+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export class SampleDto {
22
name: string;
3-
}
3+
}

0 commit comments

Comments
 (0)