diff options
author | 2022-08-04 21:59:48 +0200 | |
---|---|---|
committer | 2022-08-04 21:59:48 +0200 | |
commit | f54223fb0aaedbd101b5d3dc4176053533bb936a (patch) | |
tree | 7c34fb3c3aff23a88ef03052d66d1507f33cf7f0 /src/utils/boolean.test.ts | |
parent | b38ab82d05147b3c7452e79c6edb07e2ced18267 (diff) | |
download | it-tools-f54223fb0aaedbd101b5d3dc4176053533bb936a.tar.gz it-tools-f54223fb0aaedbd101b5d3dc4176053533bb936a.tar.zst it-tools-f54223fb0aaedbd101b5d3dc4176053533bb936a.zip |
refactor(validation): simplified validation management with helpers
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); + }); + }); +}); |