File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ describe('Optional Class Tests', () => {
162
162
163
163
it ( 'should throw an error for map on an empty Optional' , ( ) => {
164
164
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 ) ;
166
166
} ) ;
167
167
} ) ;
168
168
@@ -271,7 +271,7 @@ describe('Optional Class Tests', () => {
271
271
272
272
it ( 'should throw an error for map on an empty Optional' , ( ) => {
273
273
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 ) ;
275
275
} ) ;
276
276
} ) ;
277
277
You can’t perform that action at this time.
0 commit comments