webgl test and class validator mocker
This commit is contained in:
parent
b9a89a4ba7
commit
3ff2186deb
17 changed files with 368 additions and 72 deletions
25
server/test/helper/class_validator_mocker_test.ts
Normal file
25
server/test/helper/class_validator_mocker_test.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { Type } from "class-transformer";
|
||||
import { ClassValidatorMocker } from "../../src/core/helpers/class_validator_mocket";
|
||||
import { IsString, IsNumber, IsBoolean, IsUUID, IsMongoId, ValidateNested } from "class-validator";
|
||||
|
||||
class Foo {}
|
||||
class MyClass {
|
||||
@ValidateNested()
|
||||
@Type(() => Foo)
|
||||
model: Foo;
|
||||
|
||||
@IsNumber()
|
||||
numberProperty: number;
|
||||
|
||||
@IsBoolean()
|
||||
booleanProperty: boolean;
|
||||
|
||||
@IsUUID()
|
||||
uuidProperty: string;
|
||||
}
|
||||
|
||||
const myClassDataMock = ClassValidatorMocker.create<MyClass>(MyClass);
|
||||
|
||||
export const mainTest = () => {
|
||||
console.log(myClassDataMock);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue