aboutsummaryrefslogtreecommitdiff
path: root/src/utils/boolean.test.ts
diff options
context:
space:
mode:
authorGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2022-08-04 21:59:48 +0200
committerGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2022-08-04 21:59:48 +0200
commitf54223fb0aaedbd101b5d3dc4176053533bb936a (patch)
tree7c34fb3c3aff23a88ef03052d66d1507f33cf7f0 /src/utils/boolean.test.ts
parentb38ab82d05147b3c7452e79c6edb07e2ced18267 (diff)
downloadit-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.ts15
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);
+ });
+ });
+});