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.

22 lines
655 B

4 years ago
  1. 'use strict';
  2. var test = require('tape');
  3. var hasSymbols = require('../');
  4. var runSymbolTests = require('./tests');
  5. test('interface', function (t) {
  6. t.equal(typeof hasSymbols, 'function', 'is a function');
  7. t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean');
  8. t.end();
  9. });
  10. test('Symbols are supported', { skip: !hasSymbols() }, function (t) {
  11. runSymbolTests(t);
  12. t.end();
  13. });
  14. test('Symbols are not supported', { skip: hasSymbols() }, function (t) {
  15. t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined');
  16. t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist');
  17. t.end();
  18. });