1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
/* eslint-disable unicorn/require-array-join-separator -- required for testing */
QUnit.test('Set#join', assert => {
const { join } = Set.prototype;
assert.isFunction(join);
assert.arity(join, 1);
assert.name(join, 'join');
assert.looksNative(join);
assert.nonEnumerable(Set.prototype, 'join');
assert.same(new Set([1, 2, 3]).join(), '1,2,3');
assert.same(new Set([1, 2, 3]).join(undefined), '1,2,3');
assert.same(new Set([1, 2, 3]).join('|'), '1|2|3');
assert.throws(() => join.call(new Map()), TypeError);
assert.throws(() => join.call({}), TypeError);
assert.throws(() => join.call([]), TypeError);
assert.throws(() => join.call(undefined), TypeError);
assert.throws(() => join.call(null), TypeError);
});
|