style: fix formatting on everything

This commit is contained in:
Micael Levi L. Cavalcante
2022-08-21 14:23:19 -04:00
parent 985d794447
commit bc80ef6055
13 changed files with 57 additions and 39 deletions

View File

@@ -2,6 +2,6 @@ export const mochaHooks = (): Mocha.RootHookObject => {
return {
async beforeAll(this: Mocha.Context) {
await import('reflect-metadata');
}
},
};
};

View File

@@ -3,7 +3,6 @@ import { FooService } from './foo.service';
@Injectable()
export class BarService {
constructor(private readonly foo: FooService) {}
bar() {

View File

@@ -36,7 +36,7 @@ describe('Auto-Mocking with token in factory', () => {
const moduleRef = await Test.createTestingModule({
providers: [BarService],
})
.useMocker((token) => {
.useMocker(token => {
if (token === FooService) {
return { foo: sinon.stub };
}
@@ -48,16 +48,13 @@ describe('Auto-Mocking with token in factory', () => {
expect(fooServ.foo.called);
});
it('cannot mock the dependencies', async () => {
const moduleRef = Test.createTestingModule({
providers: [BarService],
})
.useMocker((token) => {
}).useMocker(token => {
if (token === FooService.name + 'something that fails the token') {
return { foo: sinon.stub };
}
})
.compile;
expect(moduleRef()).to.eventually.throw()
}).compile;
expect(moduleRef()).to.eventually.throw();
});
});

View File

@@ -3,7 +3,7 @@ import {
Controller,
InternalServerErrorException,
Post,
RequestTimeoutException
RequestTimeoutException,
} from '@nestjs/common';
import { ClientProxyFactory } from '@nestjs/microservices';
import { Observable, throwError } from 'rxjs';

View File

@@ -1,4 +1,12 @@
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
} from '@nestjs/common';
import { UsersService } from './users.service';
import { CreateUserDto } from './dto/create-user.dto';
import { UpdateUserDto } from './dto/update-user.dto';

View File

@@ -7,7 +7,8 @@ import type { ReplFnDefinition } from '../repl.interfaces';
export class MethodsReplFn extends ReplFunction {
public fnDefinition: ReplFnDefinition = {
name: 'methods',
description: 'Display all public methods available on a given provider or controller.',
description:
'Display all public methods available on a given provider or controller.',
signature: '(token: ClassRef | string) => void',
};

View File

@@ -1,4 +1,8 @@
import { INestApplicationContext, InjectionToken, Logger } from '@nestjs/common';
import {
INestApplicationContext,
InjectionToken,
Logger,
} from '@nestjs/common';
import { ApplicationConfig } from '../application-config';
import { ModuleRef, NestContainer } from '../injector';
import { InternalCoreModule } from '../injector/internal-core-module';

View File

@@ -3,7 +3,13 @@ import { KafkaContext } from '../../ctx-host';
import { Consumer, KafkaMessage } from '../../external/kafka.interface';
describe('KafkaContext', () => {
const args = ['test', { test: true }, undefined, { test: 'consumer' }, () => {}];
const args = [
'test',
{ test: true },
undefined,
{ test: 'consumer' },
() => {},
];
let context: KafkaContext;
beforeEach(() => {

View File

@@ -1,4 +1,3 @@
/*
* -------------------------------------------------------
* THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
@@ -13,13 +12,17 @@ export class CreateCatInput {
}
export abstract class IQuery {
abstract cats(): Nullable<Nullable<Cat>[]> | Promise<Nullable<Nullable<Cat>[]>>;
abstract cats():
| Nullable<Nullable<Cat>[]>
| Promise<Nullable<Nullable<Cat>[]>>;
abstract cat(id: string): Nullable<Cat> | Promise<Nullable<Cat>>;
}
export abstract class IMutation {
abstract createCat(createCatInput?: Nullable<CreateCatInput>): Nullable<Cat> | Promise<Nullable<Cat>>;
abstract createCat(
createCatInput?: Nullable<CreateCatInput>,
): Nullable<Cat> | Promise<Nullable<Cat>>;
}
export abstract class ISubscription {