@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
14 lines (13 loc) • 526 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const to_array_1 = require("./to-array");
describe('toArray', () => {
it('should return the provided value if it is already an array', () => {
const value = ['a', 'b'];
expect((0, to_array_1.toArray)(value)).toBe(value);
});
it('should return the provided value in a new array if it is not already an array', () => {
const value = 'a';
expect((0, to_array_1.toArray)(value)).toEqual([value]);
});
});