Skip to content

Commit 0aa1887

Browse files
committed
chore(examples): cleanup with-nest
1 parent 8d9fdbd commit 0aa1887

File tree

7 files changed

+12
-17
lines changed

7 files changed

+12
-17
lines changed

examples/with-nest/src/app.controller.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { StenoModule } from '@stenodb/nest'
33
import { resolve } from 'path'
44
import { UsersController } from './app.controller'
55
import { UsersService } from './app.service'
6-
import { initialUsersData } from './constants'
6+
import { initialUsersData } from './dto/users.dto'
77

88
describe('UsersController', () => {
99
let usersController: UsersController

examples/with-nest/src/app.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class UsersController {
77
constructor(private readonly usersService: UsersService) {}
88

99
@Get()
10-
getUsers(): CreateUserDto[] {
10+
getUsers() {
1111
return this.usersService.users
1212
}
1313

examples/with-nest/src/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { UsersService } from './app.service'
77
@Module({
88
imports: [
99
StenoModule.register({
10-
path: resolve(process.cwd(), 'db', 'users')
10+
path: resolve(process.cwd(), 'db')
1111
})
1212
],
1313
controllers: [UsersController],

examples/with-nest/src/app.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Injectable, OnModuleInit } from '@nestjs/common'
22
import { Steno, StenoService } from '@stenodb/nest'
3-
import { initialUsersData } from './constants'
4-
import { CreateUserDto, Users } from './dto/users.dto'
3+
import { CreateUserDto, initialUsersData, Users } from './dto/users.dto'
54

65
@Injectable()
76
export class UsersService implements OnModuleInit {

examples/with-nest/src/constants.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/with-nest/src/dto/users.dto.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ export class CreateUserDto {
2727
this.age = age
2828
}
2929
}
30+
31+
export const initialUsersData = new Users(
32+
new CreateUserDto(1, 'John', 20),
33+
new CreateUserDto(2, 'Jane', 21),
34+
new CreateUserDto(3, 'Jack', 22)
35+
)

examples/with-nest/test/app.e2e-spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ describe('AppController (e2e)', () => {
1515
await app.init()
1616
})
1717

18-
it('/ (GET)', () => {
19-
return request(app.getHttpServer())
20-
.get('/')
21-
.expect(200)
22-
.expect('Hello World!')
18+
it('/users (GET)', () => {
19+
return request(app.getHttpServer()).get('/users').expect(200)
2320
})
2421
})

0 commit comments

Comments
 (0)