test: update corresponding tests

This commit is contained in:
AbdlrahmanSaberAbdo
2023-06-23 10:52:19 +03:00
parent 568190a6ec
commit 10d5a86b6c

View File

@@ -27,8 +27,8 @@ describe('ParseEnumPipe', () => {
);
});
it('should not throw an error if "enumType" is undefined/null and isOptional is true', async () => {
const target = new ParseEnumPipe(null, { isOptional: true });
it('should not throw an error if enumType is undefined/null and isOptional is true', async () => {
const target = new ParseEnumPipe('DOWN', { optional: true });
const value = await target.transform(undefined, {} as ArgumentMetadata);
expect(value).to.equal(undefined);
});
@@ -51,14 +51,5 @@ describe('ParseEnumPipe', () => {
);
}
});
it('should throw an error if "enumType" is undefined/null and isOptional false', async () => {
try {
new ParseEnumPipe(null, { isOptional: false });
} catch (err) {
expect(err.message).to.equal(
`"ParseEnumPipe" requires "enumType" argument specified (to validate input values).`,
);
}
});
});
});