@tinymce/beehive-flow
Version:
A CLI tool implementing the beehive flow git branching process
19 lines (17 loc) • 574 B
text/typescript
import { describe, it } from 'mocha';
import { assert } from 'chai';
import fc from 'fast-check';
import * as ArrayUtils from '../../../main/ts/utils/ArrayUtils';
describe('ArrayUtils', () => {
describe('sort', () => {
it('returns the same number of elements', () => {
fc.assert(fc.property(fc.array(fc.integer()), (xs) => {
assert.equal(ArrayUtils.sort(xs).length, xs.length);
}));
});
it('does not mutate', () => {
const input = [ 1, 2, 3 ]; // do not inline
assert.notEqual(ArrayUtils.sort(input), input);
});
});
});