-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(codestyle): Setup eslint deps, rules and fix violations
hyperfine --warmup 5 --prepare "nx reset && nx clear-cache" \ --runs 100 "nx run-many -t lint" Time (mean ± σ): 2.686s ± 0.044s [User: 3.278s, System: 0.222s] Range (min … max): 2.594s … 2.818s 100 runs hyperfine --warmup 5 --prepare "nx reset && nx clear-cache" \ --runs 100 "nx run-many -t build" Time (mean ± σ): 2.254s ± 0.019s [User: 2.561s, System: 0.213s] Range (min … max): 2.229s … 2.372s 100 runs hyperfine --warmup 5 --prepare "nx reset && nx clear-cache" \ --runs 100 "nx run-many -t test" Time (mean ± σ): 1.636s ± 0.007s [User: 0.784s, System: 0.134s] Range (min … max): 1.611s … 1.659s 100 runs More: - https://nx.dev/recipes/tips-n-tricks/eslint
- Loading branch information
1 parent
a135fec
commit de4d116
Showing
11 changed files
with
804 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
|
||
import { AppController } from './app.controller'; | ||
import { AppService } from './app.service'; | ||
import { Test, type TestingModule } from '@nestjs/testing' | ||
import { AppController } from './app.controller' | ||
import { AppService } from './app.service' | ||
|
||
describe('AppController', () => { | ||
let app: TestingModule; | ||
let app: TestingModule | ||
|
||
beforeAll(async () => { | ||
app = await Test.createTestingModule({ | ||
controllers: [AppController], | ||
providers: [AppService], | ||
}).compile(); | ||
}); | ||
providers: [AppService] | ||
}).compile() | ||
}) | ||
|
||
describe('getData', () => { | ||
it('should return "Hello API"', () => { | ||
const appController = app.get<AppController>(AppController); | ||
expect(appController.getData()).toEqual({ message: 'Hello API' }); | ||
}); | ||
}); | ||
}); | ||
const appController = app.get(AppController) | ||
expect(appController.getData()).toEqual({ message: 'Hello API' }) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
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 { | ||
constructor(private readonly appService: AppService) {} | ||
|
||
@Get() | ||
getData() { | ||
return this.appService.getData(); | ||
return this.appService.getData() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
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: [], | ||
controllers: [AppController], | ||
providers: [AppService], | ||
providers: [AppService] | ||
}) | ||
export class AppModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
import { Test } from '@nestjs/testing'; | ||
|
||
import { AppService } from './app.service'; | ||
import { Test } from '@nestjs/testing' | ||
import { AppService } from './app.service' | ||
|
||
describe('AppService', () => { | ||
let service: AppService; | ||
let service: AppService | ||
|
||
beforeAll(async () => { | ||
const app = await Test.createTestingModule({ | ||
providers: [AppService], | ||
}).compile(); | ||
providers: [AppService] | ||
}).compile() | ||
|
||
service = app.get<AppService>(AppService); | ||
}); | ||
service = app.get<AppService>(AppService) | ||
}) | ||
|
||
describe('getData', () => { | ||
it('should return "Hello API"', () => { | ||
expect(service.getData()).toEqual({ message: 'Hello API' }); | ||
}); | ||
}); | ||
}); | ||
expect(service.getData()).toEqual({ message: 'Hello API' }) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { Injectable } from '@nestjs/common' | ||
|
||
@Injectable() | ||
export class AppService { | ||
getData(): { message: string } { | ||
return { message: 'Hello API' }; | ||
return { message: 'Hello API' } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
/** | ||
* This is not a production server yet! | ||
* This is only a minimal backend to get started. | ||
*/ | ||
|
||
import { Logger } from '@nestjs/common'; | ||
import { NestFactory } from '@nestjs/core'; | ||
|
||
import { AppModule } from './app/app.module'; | ||
import { Logger } from '@nestjs/common' | ||
import { NestFactory } from '@nestjs/core' | ||
import { AppModule } from './app/app.module' | ||
|
||
async function bootstrap() { | ||
const app = await NestFactory.create(AppModule); | ||
const globalPrefix = 'api'; | ||
app.setGlobalPrefix(globalPrefix); | ||
const port = process.env.PORT || 3000; | ||
await app.listen(port); | ||
const app = await NestFactory.create(AppModule) | ||
const globalPrefix = 'api' | ||
app.setGlobalPrefix(globalPrefix) | ||
const port = process.env.PORT ?? 3000 | ||
await app.listen(port) | ||
Logger.log( | ||
`🚀 Application is running on: http://localhost:${port}/${globalPrefix}` | ||
); | ||
) | ||
} | ||
|
||
bootstrap(); | ||
bootstrap().then(console.log).catch(console.error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.