test.js 761 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. var hasSymbolSupport;
  3. if (typeof module === 'object' && module.exports) {
  4. require('es5-shim');
  5. require('es5-shim/es5-sham');
  6. if (typeof JSON === 'undefined') {
  7. JSON = {};
  8. }
  9. require('json3').runInContext(null, JSON);
  10. require('es6-shim');
  11. var es7 = require('es7-shim');
  12. Object.keys(es7).forEach(function (key) {
  13. var obj = es7[key];
  14. if (typeof obj.shim === 'function') {
  15. obj.shim();
  16. }
  17. });
  18. hasSymbolSupport = require('../../index.js');
  19. } else {
  20. hasSymbolSupport = returnExports;
  21. }
  22. describe('Basic tests', function () {
  23. it('results should match', function () {
  24. var expected = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
  25. expect(hasSymbolSupport).toBe(expected);
  26. });
  27. });