@degjs/object-utils
Version:
A utility library for working with JavaScript objects.
19 lines (16 loc) • 366 B
JavaScript
import expect from 'expect';
import {ensureArray} from './objectUtils';
describe('ensureArray', () => {
it('should put object in array', () => {
const obj = {
test: 'best'
};
expect(ensureArray(obj)).toEqual([obj]);
});
it('should put object in array', () => {
const obj = {
test: 'best'
};
expect(ensureArray([obj])).toEqual([obj]);
});
});