mirror of
https://github.com/hanzoai/core-js.git
synced 2026-09-24 16:58:15 +00:00
15 lines
529 B
JavaScript
15 lines
529 B
JavaScript
import link from 'core-js-pure/es/string/link';
|
|
|
|
QUnit.test('String#link', assert => {
|
|
assert.isFunction(link);
|
|
assert.same(link('a', 'b'), '<a href="b">a</a>', 'lower case');
|
|
assert.same(link('a', '"'), '<a href=""">a</a>', 'escape quotes');
|
|
|
|
/* eslint-disable es/no-symbol -- safe */
|
|
if (typeof Symbol == 'function') {
|
|
const symbol = Symbol('link test');
|
|
assert.throws(() => link(symbol, 'b'), 'throws on symbol context');
|
|
assert.throws(() => link('a', symbol), 'throws on symbol argument');
|
|
}
|
|
});
|