Skip to content

Commit 2148f98

Browse files
author
Max Beatty
committed
1 parent a32e98d commit 2148f98

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

examples/babel/test/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import td from 'testdouble'
22

3-
global.context = describe
4-
global.td = td
3+
globalThis.context = describe
4+
globalThis.td = td
55

66
afterEach(() => td.reset())

examples/jest/support/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
global.td = require('../../..')
2-
global.expect = require('expect')
1+
globalThis.td = require('../../..')
2+
globalThis.expect = require('expect')
33

44
require('testdouble-jest')(td, jest)
55

examples/node/test/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
global.td = require('testdouble')
2-
global.assert = require('core-assert')
1+
globalThis.td = require('testdouble')
2+
globalThis.assert = require('core-assert')
33

44
module.exports = {
55
afterEach: function () {

test/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require('ts-node/register')
2-
global.assert = require('assert')
3-
global.ES_SUPPORT = require('./support/es-support')
2+
globalThis.assert = require('assert')
3+
globalThis.ES_SUPPORT = require('./support/es-support')
44

55
const CallLog = require('../src/value/call-log').default
66
const StubbingRegister = require('../src/value/stubbing-register').default

test/safe/log.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ module.exports = {
4343
},
4444
'when console does not exist' () {
4545
const ogConsole = console
46-
delete global.console
46+
delete globalThis.console
4747

4848
subject.warn('lolololol', 'lol')
4949

5050
// No explosions occur
51-
global.console = ogConsole
51+
globalThis.console = ogConsole
5252
}
5353
},
5454
'.error': {

test/support/tdify-plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ module.exports = {
77
test: function (runTest, metadata, cb) {
88
if (metadata.ancestorNames[1].indexOf('/test/unit/') !== -1) {
99
// Unit test -- `td` is a safe npm release so they can mock!
10-
global.td = releaseTd
10+
globalThis.td = releaseTd
1111
} else {
1212
// Safe test -- `td` is the current working copy so we can assert it!
13-
global.td = workingTd
13+
globalThis.td = workingTd
1414
}
1515
runTest(cb)
1616
}

0 commit comments

Comments
 (0)