mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-05 13:57:10 -04:00
refactor(validation): simplified validation management with helpers
This commit is contained in:
parent
b38ab82d05
commit
f54223fb0a
5 changed files with 35 additions and 39 deletions
15
src/utils/boolean.test.ts
Normal file
15
src/utils/boolean.test.ts
Normal file
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue