{"size": 1417, "ext": "js", "max_stars_repo_path": "__tests__/webpack-global-object-x.test.js", "max_stars_repo_name": "brisbanewebdeveloper/webpack-global-object-x", "max_stars_repo_stars_event_min_datetime": "2021-04-12T07:59:50.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-12T07:59:50.000Z", "max_issues_repo_path": "__tests__/webpack-global-object-x.test.js", "max_issues_repo_name": "brisbanewebdeveloper/webpack-global-object-x", "max_issues_repo_issues_event_min_datetime": "2020-01-31T13:12:17.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-10T07:46:41.000Z", "max_forks_repo_path": "__tests__/webpack-global-object-x.test.js", "max_forks_repo_name": "brisbanewebdeveloper/webpack-global-object-x", "max_forks_repo_forks_event_min_datetime": "2021-03-05T16:24:59.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-05T16:24:59.000Z"}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": 1, "avg_line_length": 28.34, "max_line_length": 78, "alphanum_fraction": 0.6732533522}
var globalObject = require('../src/webpack-global-object-x');

describe('globalObject', function() {
  it('is a function', function() {
    expect.assertions(1);
    expect(typeof globalObject).toBe('function');
  });

  it('it stringifies', function() {
    expect.assertions(1);
    expect(typeof globalObject.toString()).toBe('string');
  });

  it('returns global', function() {
    expect.assertions(1);
    expect(globalObject()).toBe(global);
  });

  it('returns global without defineProperty', function() {
    expect.assertions(1);
    var defineProperty = Object.defineProperty;
    delete Object.defineProperty;
    expect(globalObject()).toBe(global);
    defineProperty(Object, 'defineProperty', {
      configurable: true,
      value: defineProperty,
      writable: true
    });
  });

  it('returns global without defineProperty or __defineGetter__', function() {
    expect.assertions(1);
    var defineProperty = Object.defineProperty;
    delete Object.defineProperty;
    var defineGetter = Object.prototype.__defineGetter__;
    delete Object.prototype.__defineGetter__;
    expect(globalObject()).toBe(global);
    defineProperty(Object, 'defineProperty', {
      configurable: true,
      value: defineProperty,
      writable: true
    });
    defineProperty(Object.prototype, '__defineGetter__', {
      configurable: true,
      value: defineGetter,
      writable: true
    });
  });
});
