Files
directus/src/utils/is-empty/is-empty.test.ts
Rijk van Zanten 68c625ec79 Document and structure utils / compositions (#168)
* Document and structure utils / compositions

* Fix tests

* Ignore tests in sonar cloud?

* Please sonar don't use my test files
2020-03-12 12:31:36 -04:00

28 lines
745 B
TypeScript

import { isEmpty, notEmpty } from './is-empty';
describe('Util / isEmpty', () => {
describe('isEmpty', () => {
it('Returns true if value is null or undefined', () => {
expect(isEmpty(null)).toBe(true);
expect(isEmpty(undefined)).toBe(true);
});
it('Returns false if value is not null or undefined', () => {
expect(isEmpty('test')).toBe(false);
expect(isEmpty(123)).toBe(false);
});
});
describe('notEmpty', () => {
it('Returns true if value is null or undefined', () => {
expect(notEmpty(null)).toBe(false);
expect(notEmpty(undefined)).toBe(false);
});
it('Returns true if value is not null or undefined', () => {
expect(notEmpty('test')).toBe(true);
expect(notEmpty(123)).toBe(true);
});
});
});