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
686 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('get-own-property-symbols');
  16. require('../tests')(t);
  17. var hasSymbolsAfter = hasSymbols();
  18. t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling');
  19. /* eslint-enable global-require */
  20. t.end();
  21. });