File tree 3 files changed +5
-9
lines changed
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`:
37
37
import * as td from ' testdouble'
38
38
39
39
// CommonJS modules (e.g. Node.js)
40
- global .td = require (' testdouble' )
40
+ globalThis .td = require (' testdouble' )
41
41
42
42
// Global set in our browser distribution
43
43
window .td
@@ -583,5 +583,3 @@ directory:
583
583
* [ td.matchers] ( /docs/5-stubbing-results.md#loosening-stubbings-with-argument-matchers )
584
584
and [ custom matchers] ( /docs/8-custom-matchers.md#custom-argument-matchers ) for
585
585
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
15
15
using ` td ` , so in a test helper loaded before your tests:
16
16
17
17
```
18
- global .td = require('testdouble')
18
+ globalThis .td = require('testdouble')
19
19
```
20
20
21
21
All examples in these documents will assume ` testdouble ` is available as ` td ` .
@@ -64,7 +64,7 @@ without any test library at all.
64
64
65
65
Our browser distribution sets the library on a global variable named ` window.td ` .
66
66
In 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
68
68
terseness sake).
69
69
70
70
You'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')
4
4
var repl = require ( 'repl' )
5
5
6
6
console . 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' )
9
9
repl . start ( { prompt : 'td > ' , useGlobal : true } )
10
-
11
-
You can’t perform that action at this time.
0 commit comments