Skip to content

Commit 02886e2

Browse files
committed
fix tests
1 parent 9aaf205 commit 02886e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/optional.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ describe('Optional Class Tests', () => {
162162

163163
it('should throw an error for map on an empty Optional', () => {
164164
const optional = Optional.empty();
165-
expect(() => optional.flatMap((x) => Optional.of( 2*(x||1))).isEmpty()).toThrow("FlatMap operation cannot be called on an empty Optional");
165+
expect( optional.flatMap((x) => Optional.of( 2*(x||1))).isEmpty()).toBe(true);
166166
});
167167
});
168168

@@ -271,7 +271,7 @@ describe('Optional Class Tests', () => {
271271

272272
it('should throw an error for map on an empty Optional', () => {
273273
const optional = Optional.empty();
274-
expect(()=> optional.map((x) => (x || 1) * 2)).toThrow("Map operation cannot be called on an empty Optional");
274+
expect( optional.map((x) => (x || 1) * 2).isEmpty()).toBe(true);
275275
});
276276
});
277277

0 commit comments

Comments
 (0)