Constnium/node_modules/has-tostringtag/test/tests.js

15 lines
427 B
JavaScript
Raw Permalink Normal View History

2022-06-23 02:27:43 +02:00
'use strict';
// eslint-disable-next-line consistent-return
module.exports = function runSymbolTests(t) {
t.equal(typeof Symbol, 'function', 'global Symbol is a function');
t.ok(Symbol.toStringTag, 'Symbol.toStringTag exists');
if (typeof Symbol !== 'function' || !Symbol.toStringTag) { return false; }
var obj = {};
obj[Symbol.toStringTag] = 'test';
t.equal(Object.prototype.toString.call(obj), '[object test]');
};