File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed
Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ convenience to the shorthand `td`:
3737import * as td from ' testdouble'
3838
3939// CommonJS modules (e.g. Node.js)
40- global .td = require (' testdouble' )
40+ globalThis .td = require (' testdouble' )
4141
4242// Global set in our browser distribution
4343window .td
@@ -583,5 +583,3 @@ directory:
583583* [ td.matchers] ( /docs/5-stubbing-results.md#loosening-stubbings-with-argument-matchers )
584584 and [ custom matchers] ( /docs/8-custom-matchers.md#custom-argument-matchers ) for
585585 configuring more advanced stubbings and verifications
586-
587-
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ test suite and to name that global something brief. We've been accustomed to
1515using ` td ` , so in a test helper loaded before your tests:
1616
1717```
18- global .td = require('testdouble')
18+ globalThis .td = require('testdouble')
1919```
2020
2121All examples in these documents will assume ` testdouble ` is available as ` td ` .
@@ -64,7 +64,7 @@ without any test library at all.
6464
6565Our browser distribution sets the library on a global variable named ` window.td ` .
6666In Node.js, the library is loaded via ` require('testdouble') ` , as you might
67- expect (though we recommend assigning it to ` global .td` in a test helper, for
67+ expect (though we recommend assigning it to ` globalThis .td` in a test helper, for
6868terseness sake).
6969
7070You're welcome to address testdouble.js or any of its functions however you prefer,
Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ require('ts-node/register')
44var repl = require ( 'repl' )
55
66console . log ( '💚 Let\'s play with testdouble.js! 💚' )
7- global . td = require ( '../src' )
8- global . l = require ( 'lodash' )
7+ globalThis . td = require ( '../src' )
8+ globalThis . l = require ( 'lodash' )
99repl . start ( { prompt : 'td > ' , useGlobal : true } )
10-
11-
You can’t perform that action at this time.
0 commit comments