From 44ec1b1b4dfbb1be8ed972ceeb78b770637d57d5 Mon Sep 17 00:00:00 2001 From: Clement Denis Date: Thu, 23 Jul 2020 18:16:05 +0200 Subject: [PATCH] js/test: add join to prototype before assertion --- js/tests/test.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/tests/test.mjs b/js/tests/test.mjs index 13697def2..c6b3ac46f 100644 --- a/js/tests/test.mjs +++ b/js/tests/test.mjs @@ -25,9 +25,12 @@ const { join } = [] const { split } = '' const eq = (a, b) => { const noSplit = !''.split + const noJoin = ![].join String.prototype.split = split + String.prototype.split = join deepStrictEqual(a, b) noSplit && (String.prototype.split = undefined) + noJoin && (Array.prototype.join = undefined) return true }