You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
723 B

4 years ago
  1. 'use strict';
  2. var test = require('tape');
  3. if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
  4. test('has native Symbol support', function (t) {
  5. t.equal(typeof Symbol, 'function');
  6. t.equal(typeof Symbol(), 'symbol');
  7. t.end();
  8. });
  9. return;
  10. }
  11. var hasSymbols = require('../../shams');
  12. test('polyfilled Symbols', function (t) {
  13. /* eslint-disable global-require */
  14. t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling');
  15. require('core-js/fn/symbol');
  16. require('core-js/fn/symbol/to-string-tag');
  17. require('../tests')(t);
  18. var hasSymbolsAfter = hasSymbols();
  19. t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling');
  20. /* eslint-enable global-require */
  21. t.end();
  22. });