Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('Usage with a Hook', () => {
class SocialPost {
@Length(10, 20)
title: string;
@Contains('hello')
text: string;
}
class SocialPostController {
@Post()
@ValidateBodyFromClass(SocialPost, { /* options if relevant */ })
createSocialPost() {
// ...
return new HttpResponseCreated();
}
}
const app = createApp(SocialPostController);
return request(app)
.post('/')
.send({ text: 'foo' })
.expect(400)
.expect([
{
children: [],
it('Usage with a Hook', () => {
class SocialPost {
@Length(10, 20)
title: string;
@Contains('hello')
text: string;
}
class SocialPostController {
@Post()
@ValidateBodyFromClass(SocialPost, { /* options if relevant */ })
createSocialPost() {
// ...
return new HttpResponseCreated();
}
}
const app = createApp(SocialPostController);
it('Usage with a Hook', () => {
class SocialPost {
@Length(10, 20)
title: string;
@Contains('hello')
text: string;
}
class SocialPostController {
@Post()
@ValidateBodyFromClass(SocialPost, { /* options if relevant */ })
createSocialPost() {
// ...
return new HttpResponseCreated();
}