From 098f3dc2663da478a76c98a4f1aadbfed84923bc Mon Sep 17 00:00:00 2001 From: Endel Dreyer Date: Tue, 5 May 2020 14:16:51 +0300 Subject: [PATCH] add test for unbound array.sort() --- test/ArraySchemaTest.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/ArraySchemaTest.ts b/test/ArraySchemaTest.ts index c8ea063f..f8742257 100644 --- a/test/ArraySchemaTest.ts +++ b/test/ArraySchemaTest.ts @@ -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(1, 2, 3, 4, 5); + assert.doesNotThrow(() => arr.sort()); + }); + + it("should allow slice() + sort() unbound array", () => { const arr = new ArraySchema(1, 2, 3, 4, 5); assert.doesNotThrow(() => arr.slice(0).sort()); }); + });