Commit 4da8137f authored by nanahira's avatar nanahira

bump

parent e1d3a44a
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
"testEnvironment": "node" "testEnvironment": "node"
}, },
"devDependencies": { "devDependencies": {
"@nestjs/core": "^9.4.0", "@nestjs/core": "^11.0.14",
"@nestjs/platform-express": "^9.0.3", "@nestjs/platform-express": "^11.0.14",
"@nestjs/testing": "^9.0.3", "@nestjs/testing": "^11.0.14",
"@nestjs/typeorm": "^9.0.0", "@nestjs/typeorm": "^11.0.0",
"@types/jest": "^28.1.5", "@types/jest": "^28.1.5",
"@types/lodash": "^4.14.182", "@types/lodash": "^4.14.182",
"@types/node": "^18.0.4", "@types/node": "^18.0.4",
...@@ -61,15 +61,15 @@ ...@@ -61,15 +61,15 @@
"typescript": "^4.7.4" "typescript": "^4.7.4"
}, },
"peerDependencies": { "peerDependencies": {
"@nestjs/common": "^9.4.0 || ^10.0.0", "@nestjs/common": "^9.4.0 || ^10.0.0 || ^11.0.14",
"@nestjs/swagger": "^7.1.8 || ^6.3.0", "@nestjs/swagger": "^7.1.8 || ^6.3.0 || ^11.1.1",
"class-transformer": "^0.5.1", "class-transformer": "^0.5.1",
"class-validator": "^0.14.0", "class-validator": "^0.14.0",
"typeorm": "^0.3.16" "typeorm": "^0.3.16"
}, },
"dependencies": { "dependencies": {
"lodash": "^4.17.21", "lodash": "^4.17.21",
"nesties": "^1.0.1", "nesties": "^1.1.1",
"typed-reflector": "^1.0.11" "typed-reflector": "^1.0.11"
} }
} }
...@@ -49,7 +49,7 @@ function swaggerDecorator( ...@@ -49,7 +49,7 @@ function swaggerDecorator(
description: options.description, description: options.description,
...injected, ...injected,
...(options.propertyExtras || {}), ...(options.propertyExtras || {}),
}); } as ApiPropertyOptions);
} }
function validatorDecorator(options: OpenAPIOptions<any>) { function validatorDecorator(options: OpenAPIOptions<any>) {
...@@ -177,7 +177,7 @@ export const EnumColumn = <T>( ...@@ -177,7 +177,7 @@ export const EnumColumn = <T>(
}), }),
IsEnum(targetEnum), IsEnum(targetEnum),
validatorDecorator(options), validatorDecorator(options),
swaggerDecorator(options, { type: 'enum', enum: targetEnum }), swaggerDecorator(options, { enum: targetEnum }),
]); ]);
}; };
......
import { NestExpressApplication } from '@nestjs/platform-express'; import { NestExpressApplication } from '@nestjs/platform-express';
import { Controller, Injectable } from '@nestjs/common'; import { Controller, Injectable } from '@nestjs/common';
import { CrudService } from '../src/crud-base'; import { CrudService } from '../src/crud-base';
import { User } from './utility/user'; import { Gender, User } from './utility/user';
import { RestfulFactory } from '../src/decorators'; import { RestfulFactory } from '../src/decorators';
import { InjectDataSource } from '@nestjs/typeorm'; import { InjectDataSource, TypeOrmModule } from '@nestjs/typeorm';
import { DataSource } from 'typeorm'; import { DataSource } from 'typeorm';
import { Test } from '@nestjs/testing';
import request from 'supertest';
@Injectable() @Injectable()
class UserService extends CrudService(User) { class UserService extends CrudService(User) {
...@@ -52,6 +54,7 @@ describe('app', () => { ...@@ -52,6 +54,7 @@ describe('app', () => {
}); });
}); });
/* /*
describe('app', () => { describe('app', () => {
let app: NestExpressApplication; let app: NestExpressApplication;
...@@ -107,39 +110,37 @@ describe('app', () => { ...@@ -107,39 +110,37 @@ describe('app', () => {
await request(server) await request(server)
.post('/user') .post('/user')
.send({ name: 'Yuzu', age: 20, gender: 'F' }) .send({ name: 'Yuzu', age: 20, gender: 'F' })
.expect(201); .expect(200);
await request(server) await request(server)
.get('/user/1') .get('/user/1')
.expect({ .expect(res => {
success: true, expect(res.body.success).toBe(true);
statusCode: 200, expect(res.body.data).toMatchObject({
message: 'success', id: 1,
data: { id: 1, name: 'Yuzu', age: 20, gender: 'F' }, name: 'Yuzu',
age: 20,
gender: 'F',
});
}); });
await request(server) await request(server)
.patch('/user/1') .patch('/user/1')
.send({ name: 'Nana' }) .send({ name: 'Nana' })
.expect(200) .expect(200);
.expect({
success: true,
statusCode: 200,
message: 'success',
});
await request(server) await request(server)
.get('/user/1') .get('/user/1')
.expect({ .expect(200)
success: true, .expect(res => {
statusCode: 200, expect(res.body.success).toBe(true);
message: 'success', expect(res.body.data).toMatchObject({
data: { id: 1, name: 'Nana', age: 20, gender: 'F' }, id: 1,
name: 'Nana',
age: 20,
gender: 'F',
});
}); });
await request(server).delete('/user/1').expect({ await request(server).delete('/user/1').expect(200);
success: true,
statusCode: 204,
message: 'success',
});
await request(server).get('/user/1').expect(404); await request(server).get('/user/1').expect(404);
}); });
}); });
*/ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment