Skip to content

Commit

Permalink
add test for unbound array.sort()
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed May 5, 2020
1 parent 3a34afb commit 098f3dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/ArraySchemaTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,15 @@ describe("ArraySchema", () => {
assert.deepEqual([1, 1], decodedState.numbers);
});

it("should allow slice() + sort()", () => {
it("should allow sort() unbound array", () => {
const arr = new ArraySchema<number>(1, 2, 3, 4, 5);
assert.doesNotThrow(() => arr.sort());
});

it("should allow slice() + sort() unbound array", () => {
const arr = new ArraySchema<number>(1, 2, 3, 4, 5);
assert.doesNotThrow(() => arr.slice(0).sort());
});


});

0 comments on commit 098f3dc

Please sign in to comment.