Skip to content

Commit 9d0551f

Browse files
style(): run prettier
1 parent 524dc72 commit 9d0551f

86 files changed

Lines changed: 506 additions & 449 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

integration/cache/src/multi-store/multi-store.module.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import * as redisStore from 'cache-manager-redis-store';
33
import { MultiStoreController } from './multi-store.controller';
44

55
@Module({
6-
imports: [CacheModule.register([
6+
imports: [
7+
CacheModule.register([
78
{
89
store: 'memory',
910
max: 100,
@@ -14,10 +15,10 @@ import { MultiStoreController } from './multi-store.controller';
1415
host: 'localhost',
1516
port: 6379,
1617
db: 0,
17-
ttl: 600
18-
}
19-
],
20-
)],
18+
ttl: 600,
19+
},
20+
]),
21+
],
2122
controllers: [MultiStoreController],
2223
})
2324
export class MultiStoreModule {}

integration/hello-world/e2e/exclude-middleware-fastify.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ describe('Exclude middleware (fastify)', () => {
9191
});
9292

9393
it(`should not exclude "/test/test" endpoint`, () => {
94-
return request(app.getHttpServer()).get('/test/test').expect(200, MIDDLEWARE_VALUE);
94+
return request(app.getHttpServer())
95+
.get('/test/test')
96+
.expect(200, MIDDLEWARE_VALUE);
9597
});
9698

9799
it(`should not exclude "/test2" endpoint`, () => {

integration/hooks/e2e/lifecycle-hook-order.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class TestInjectable
1616
OnModuleInit,
1717
OnModuleDestroy,
1818
OnApplicationShutdown,
19-
BeforeApplicationShutdown {
19+
BeforeApplicationShutdown
20+
{
2021
onApplicationBootstrap = Sinon.spy();
2122
beforeApplicationShutdown = Sinon.spy();
2223
onApplicationShutdown = Sinon.spy();

integration/hooks/src/enable-shutdown-hooks-main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const SIGNAL_TO_LISTEN = process.argv[3];
1010

1111
@Injectable()
1212
class TestInjectable
13-
implements OnApplicationShutdown, BeforeApplicationShutdown {
13+
implements OnApplicationShutdown, BeforeApplicationShutdown
14+
{
1415
beforeApplicationShutdown(signal: string) {
1516
console.log('beforeApplicationShutdown ' + signal);
1617
}

integration/injector/e2e/core-injectables.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ describe('Core Injectables', () => {
1414
});
1515

1616
it('should provide ApplicationConfig as core injectable', () => {
17-
const applicationConfig = testingModule.get<ApplicationConfig>(
18-
ApplicationConfig,
19-
);
17+
const applicationConfig =
18+
testingModule.get<ApplicationConfig>(ApplicationConfig);
2019

2120
applicationConfig.setGlobalPrefix('/api');
2221

integration/microservices/src/app.module.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ class ClientOptionService implements ClientsModuleOptionsFactory {
5959
name: 'USE_CLASS_CLIENT',
6060
useClass: ClientOptionService,
6161
inject: [ConfigService],
62-
}, {
62+
},
63+
{
6364
imports: [ConfigModule],
6465
inject: [ConfigService],
6566
name: 'CUSTOM_PROXY_CLIENT',
6667
useFactory: (config: ConfigService) => ({
67-
customClass: ErrorHandlingProxy
68-
})
69-
}
68+
customClass: ErrorHandlingProxy,
69+
}),
70+
},
7071
]),
7172
],
7273
controllers: [AppController],

integration/microservices/src/disconnected.controller.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,21 @@ export class DisconnectedClientController {
1414
@Post()
1515
call(@Body() options): Observable<number> {
1616
const client = ClientProxyFactory.create(options);
17-
return client
18-
.send<number, number[]>({ cmd: 'none' }, [1, 2, 3])
19-
.pipe(
20-
/*tap(
17+
return client.send<number, number[]>({ cmd: 'none' }, [1, 2, 3]).pipe(
18+
/*tap(
2119
console.log.bind(console, 'data'),
2220
console.error.bind(console, 'error'),
2321
),*/
24-
catchError(error => {
25-
const { code } = error || { code: 'CONN_ERR' };
26-
return throwError(() =>
27-
code === 'ECONNREFUSED' ||
28-
code === 'CONN_ERR' ||
29-
code === 'CONNECTION_REFUSED'
30-
? new RequestTimeoutException('ECONNREFUSED')
31-
: new InternalServerErrorException(),
32-
);
33-
}),
34-
);
22+
catchError(error => {
23+
const { code } = error || { code: 'CONN_ERR' };
24+
return throwError(() =>
25+
code === 'ECONNREFUSED' ||
26+
code === 'CONN_ERR' ||
27+
code === 'CONNECTION_REFUSED'
28+
? new RequestTimeoutException('ECONNREFUSED')
29+
: new InternalServerErrorException(),
30+
);
31+
}),
32+
);
3533
}
3634
}

integration/microservices/src/kafka-concurrent/kafka-concurrent.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const explicitPartitioner = () => {
2323

2424
@Controller()
2525
export class KafkaConcurrentController
26-
implements OnModuleInit, OnModuleDestroy {
26+
implements OnModuleInit, OnModuleDestroy
27+
{
2728
protected readonly logger = new Logger(KafkaConcurrentController.name);
2829

2930
@Client({

integration/send-files/e2e/express.spec.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { ExpressAdapter, NestExpressApplication } from '@nestjs/platform-express';
1+
import {
2+
ExpressAdapter,
3+
NestExpressApplication,
4+
} from '@nestjs/platform-express';
25
import { Test } from '@nestjs/testing';
36
import { expect } from 'chai';
47
import { readFileSync } from 'fs';
@@ -24,15 +27,15 @@ describe('Express FileSend', () => {
2427
return request(app.getHttpServer())
2528
.get('/file/stream/')
2629
.expect(200)
27-
.expect((res) => {
30+
.expect(res => {
2831
expect(res.body.toString()).to.be.eq(readmeString);
2932
});
3033
});
3134
it('should return a file from a buffer', async () => {
3235
return request(app.getHttpServer())
3336
.get('/file/buffer')
3437
.expect(200)
35-
.expect((res) => {
38+
.expect(res => {
3639
expect(res.body.toString()).to.be.eq(readmeString);
3740
});
3841
});
@@ -46,8 +49,8 @@ describe('Express FileSend', () => {
4649
return request(app.getHttpServer())
4750
.get('/file/rxjs/stream/')
4851
.expect(200)
49-
.expect((res) => {
52+
.expect(res => {
5053
expect(res.body.toString()).to.be.eq(readmeString);
5154
});
5255
});
53-
});
56+
});
Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
1+
import {
2+
FastifyAdapter,
3+
NestFastifyApplication,
4+
} from '@nestjs/platform-fastify';
25
import { Test } from '@nestjs/testing';
36
import { expect } from 'chai';
47
import { readFileSync } from 'fs';
@@ -20,40 +23,48 @@ describe('Fastify FileSend', () => {
2023
});
2124

2225
it('should return a file from a stream', async () => {
23-
return app.inject({
24-
method: 'GET',
25-
url: '/file/stream'
26-
}).then(({ payload }) => {
27-
expect(payload.toString()).to.be.eq(readmeString);
28-
});
26+
return app
27+
.inject({
28+
method: 'GET',
29+
url: '/file/stream',
30+
})
31+
.then(({ payload }) => {
32+
expect(payload.toString()).to.be.eq(readmeString);
33+
});
2934
});
3035
it('should return a file from a buffer', async () => {
31-
return app.inject({
32-
method: 'GET',
33-
url: '/file/buffer',
34-
}).then(({ payload }) => {
35-
expect(payload.toString()).to.be.eq(readmeString);
36-
});
36+
return app
37+
.inject({
38+
method: 'GET',
39+
url: '/file/buffer',
40+
})
41+
.then(({ payload }) => {
42+
expect(payload.toString()).to.be.eq(readmeString);
43+
});
3744
});
3845
/**
3946
* It seems that Fastify has a similar issue as Kamil initially pointed out
4047
* If a class has a `pipe` method, it will be treated as a stream. This means
4148
* that the `NonFile` test is a failed case for fastify, hence the skip.
4249
*/
4350
it.skip('should not stream a non-file', async () => {
44-
return app.inject({
45-
url: '/non-file/pipe-method',
46-
method: 'get'
47-
}).then(({ payload }) => {
48-
expect(payload).to.be.eq({ value: 'Hello world' });
49-
});
51+
return app
52+
.inject({
53+
url: '/non-file/pipe-method',
54+
method: 'get',
55+
})
56+
.then(({ payload }) => {
57+
expect(payload).to.be.eq({ value: 'Hello world' });
58+
});
5059
});
5160
it('should return a file from an RxJS stream', async () => {
52-
return app.inject({
53-
method: 'GET',
54-
url: '/file/rxjs/stream'
55-
}).then(({ payload }) => {
56-
expect(payload.toString()).to.be.eq(readmeString);
57-
});
61+
return app
62+
.inject({
63+
method: 'GET',
64+
url: '/file/rxjs/stream',
65+
})
66+
.then(({ payload }) => {
67+
expect(payload.toString()).to.be.eq(readmeString);
68+
});
5869
});
5970
});

0 commit comments

Comments
 (0)