Browse Source

js/test: add join to prototype before assertion

pull/663/head
Clement Denis 4 years ago
parent
commit
44ec1b1b4d
  1. 3
      js/tests/test.mjs

3
js/tests/test.mjs

@ -25,9 +25,12 @@ const { join } = []
const { split } = '' const { split } = ''
const eq = (a, b) => { const eq = (a, b) => {
const noSplit = !''.split const noSplit = !''.split
const noJoin = ![].join
String.prototype.split = split String.prototype.split = split
String.prototype.split = join
deepStrictEqual(a, b) deepStrictEqual(a, b)
noSplit && (String.prototype.split = undefined) noSplit && (String.prototype.split = undefined)
noJoin && (Array.prototype.join = undefined)
return true return true
} }

Loading…
Cancel
Save