diff --git a/test/native.js b/test/native.js index d426f54..7a085ab 100644 --- a/test/native.js +++ b/test/native.js @@ -4,18 +4,23 @@ var test = require('tape'); var defineProperties = require('define-properties'); var isEnumerable = Object.prototype.propertyIsEnumerable; +var missing = {}; +var theGlobal = typeof globalThis === 'object' ? globalThis : missing; + var runTests = require('./tests'); -test('native', function (t) { - t.equal(typeof global, 'object', 'global is an object'); - t.equal(global in global, true, 'global is in global'); +test('native', { todo: theGlobal === missing }, function (t) { + if (theGlobal !== missing) { + t.equal(typeof theGlobal, 'object', 'globalThis is an object'); + t.equal('globalThis' in theGlobal, true, 'globalThis is in globalThis'); - t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { - et.equal(false, isEnumerable.call(global, 'global'), 'global is not enumerable'); - et.end(); - }); + t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { + et.equal(false, isEnumerable.call(theGlobal, 'globalThis'), 'globalThis is not enumerable'); + et.end(); + }); - runTests(global, t); + runTests(theGlobal, t); + } t.end(); });