diff options
Diffstat (limited to 'src/utils/boolean.test.ts')
-rw-r--r-- | src/utils/boolean.test.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/boolean.test.ts b/src/utils/boolean.test.ts new file mode 100644 index 0000000..20b8e33 --- /dev/null +++ b/src/utils/boolean.test.ts @@ -0,0 +1,15 @@ +import { describe, expect, it } from 'vitest'; +import { isNotThrowing } from './boolean'; + +describe('boolean utils', () => { + describe('isNotThrowing', () => { + it('should return if the call throws or false otherwise', () => { + expect(isNotThrowing(() => {})).to.eql(true); + expect( + isNotThrowing(() => { + throw new Error(); + }), + ).to.eql(false); + }); + }); +}); |