The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/tests/unit/lib/utils/arrayUtils.tests.ts

19 lines
555 B

import { expect } from 'chai';
import { ensureArray } from '../../../../lib/utils/arrayUtils';
describe('Array utils', () => {
it('should return an array with one item', () => {
const value = 'value';
const result = ensureArray(value);
expect(result).to.be.an('Array').with.lengthOf(1).and.eql([value]);
});
it('should return a new array with the same items', () => {
const value = ['value1', 'value2'];
const result = ensureArray(value);
expect(result).to.be.an('Array').with.lengthOf(2).and.eql(value).and.not.equal(value);
});
});