Skip to content

Commit 331ceb3

Browse files
committed
test(pipes): not nullable
1 parent 24e41e3 commit 331ceb3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/pipes/parseBoolean.pipe.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ describe('ParseBooleanPipe', () => {
66
it('Should parse the given string as boolean (false)', () =>
77
expect(ParseBooleanPipe()('false')).toStrictEqual(false));
88

9+
it('Should throw required error the given value is empty', () =>
10+
expect(() => ParseBooleanPipe({ nullable: false })('')).toThrow());
11+
912
it('Should throw when the given string is not a boolean string', () =>
10-
expect(() => ParseBooleanPipe()('teste')).toThrow());
13+
expect(() => ParseBooleanPipe()('test')).toThrow());
1114
});

lib/pipes/parseNumber.pipe.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ describe('ParseNumberPipe', () => {
66
it('Should parse the given string as number with decimal points', () =>
77
expect(ParseNumberPipe()('07.99')).toStrictEqual(7.99));
88

9+
it('Should throw required error the given value is empty', () =>
10+
expect(() => ParseNumberPipe({ nullable: false })('')).toThrow());
11+
912
it('Should throw when the given string is not a numeric string', () =>
1013
expect(() => ParseNumberPipe()('test')).toThrow());
1114
});

0 commit comments

Comments
 (0)