Skip to content

Commit a29d740

Browse files
committed
Refactor test for Try class to use unwrap method and validate error handling
- Updated the test case to utilize the `unwrap` method instead of `value`. - Adjusted the expectation to check for rejection with the correct error message. Signed-off-by: w01fgang <sumin@unix-center.ru>
1 parent 517756f commit a29d740

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/__tests__/Try.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,10 @@ describe('Try', () => {
244244
const params = { parameterKey: 'alpha' };
245245
const finallySpy = vi.fn();
246246

247-
await new Try(throwingFunction, params)
247+
const exec = new Try(throwingFunction, params)
248248
.finally(finallySpy)
249-
.value();
250-
249+
.unwrap();
250+
await expect(exec).rejects.toThrow('boom');
251251
expect(finallySpy).toHaveBeenCalledTimes(1);
252252
});
253253
});

0 commit comments

Comments
 (0)