@@ -11,10 +11,10 @@ const returns = wraptile(id);
1111const { _CURRENT_FILE } = currentFile ;
1212
1313test ( 'current-file: setCurrentName: setAttribute' , ( t ) => {
14- const { DOM , CloudCmd} = global ;
14+ const { DOM , CloudCmd} = globalThis ;
1515
16- global . DOM = getDOM ( ) ;
17- global . CloudCmd = getCloudCmd ( ) ;
16+ globalThis . DOM = getDOM ( ) ;
17+ globalThis . CloudCmd = getCloudCmd ( ) ;
1818
1919 const current = create ( ) ;
2020 const { setAttribute} = current ;
@@ -23,17 +23,17 @@ test('current-file: setCurrentName: setAttribute', (t) => {
2323
2424 t . calledWith ( setAttribute , [ 'data-name' , 'js-file-aGVsbG8=' ] , 'should call setAttribute' ) ;
2525
26- global . DOM = DOM ;
27- global . CloudCmd = CloudCmd ;
26+ globalThis . DOM = DOM ;
27+ globalThis . CloudCmd = CloudCmd ;
2828
2929 t . end ( ) ;
3030} ) ;
3131
3232test ( 'current-file: setCurrentName: setAttribute: cyrillic' , ( t ) => {
33- const { DOM , CloudCmd} = global ;
33+ const { DOM , CloudCmd} = globalThis ;
3434
35- global . DOM = getDOM ( ) ;
36- global . CloudCmd = getCloudCmd ( ) ;
35+ globalThis . DOM = getDOM ( ) ;
36+ globalThis . CloudCmd = getCloudCmd ( ) ;
3737
3838 const current = create ( ) ;
3939 const { setAttribute} = current ;
@@ -42,8 +42,8 @@ test('current-file: setCurrentName: setAttribute: cyrillic', (t) => {
4242
4343 t . calledWith ( setAttribute , [ 'data-name' , 'js-file-JUQwJUIwJUQwJUI5' ] , 'should call setAttribute' ) ;
4444
45- global . DOM = DOM ;
46- global . CloudCmd = CloudCmd ;
45+ globalThis . DOM = DOM ;
46+ globalThis . CloudCmd = CloudCmd ;
4747
4848 t . end ( ) ;
4949} ) ;
@@ -59,12 +59,12 @@ test('current-file: getCurrentName', (t) => {
5959} ) ;
6060
6161test ( 'current-file: emit' , ( t ) => {
62- const { DOM , CloudCmd} = global ;
62+ const { DOM , CloudCmd} = globalThis ;
6363
6464 const emit = stub ( ) ;
6565
66- global . DOM = getDOM ( ) ;
67- global . CloudCmd = getCloudCmd ( {
66+ globalThis . DOM = getDOM ( ) ;
67+ globalThis . CloudCmd = getCloudCmd ( {
6868 emit,
6969 } ) ;
7070
@@ -74,98 +74,98 @@ test('current-file: emit', (t) => {
7474
7575 t . calledWith ( emit , [ 'current-file' , current ] , 'should call emit' ) ;
7676
77- global . DOM = DOM ;
78- global . CloudCmd = CloudCmd ;
77+ globalThis . DOM = DOM ;
78+ globalThis . CloudCmd = CloudCmd ;
7979
8080 t . end ( ) ;
8181} ) ;
8282
8383test ( 'current-file: setCurrentName: return' , ( t ) => {
84- const { DOM , CloudCmd} = global ;
84+ const { DOM , CloudCmd} = globalThis ;
8585
8686 const link = { } ;
8787
88- global . DOM = getDOM ( {
88+ globalThis . DOM = getDOM ( {
8989 link,
9090 } ) ;
9191
92- global . CloudCmd = getCloudCmd ( ) ;
92+ globalThis . CloudCmd = getCloudCmd ( ) ;
9393
9494 const current = create ( ) ;
9595
9696 const result = currentFile . setCurrentName ( 'hello' , current ) ;
9797
9898 t . equal ( result , link , 'should return link' ) ;
9999
100- global . DOM = DOM ;
101- global . CloudCmd = CloudCmd ;
100+ globalThis . DOM = DOM ;
101+ globalThis . CloudCmd = CloudCmd ;
102102
103103 t . end ( ) ;
104104} ) ;
105105
106106test ( 'current-file: getParentDirPath: result' , ( t ) => {
107- const { DOM } = global ;
107+ const { DOM } = globalThis ;
108108
109109 const getCurrentDirPath = returns ( '/D/Films/+++favorite films/' ) ;
110110 const getCurrentDirName = returns ( '+++favorite films' ) ;
111111
112- global . DOM = getDOM ( {
112+ globalThis . DOM = getDOM ( {
113113 getCurrentDirPath,
114114 getCurrentDirName,
115115 } ) ;
116116
117117 const result = currentFile . getParentDirPath ( ) ;
118118 const expected = '/D/Films/' ;
119119
120- global . DOM = DOM ;
120+ globalThis . DOM = DOM ;
121121
122122 t . equal ( result , expected , 'should return parent dir path' ) ;
123123 t . end ( ) ;
124124} ) ;
125125
126126test ( 'current-file: isCurrentFile: no' , ( t ) => {
127- const { DOM , CloudCmd} = global ;
127+ const { DOM , CloudCmd} = globalThis ;
128128
129- global . DOM = getDOM ( ) ;
130- global . CloudCmd = getCloudCmd ( ) ;
129+ globalThis . DOM = getDOM ( ) ;
130+ globalThis . CloudCmd = getCloudCmd ( ) ;
131131
132132 const result = currentFile . isCurrentFile ( ) ;
133133
134- global . DOM = DOM ;
135- global . CloudCmd = CloudCmd ;
134+ globalThis . DOM = DOM ;
135+ globalThis . CloudCmd = CloudCmd ;
136136
137137 t . notOk ( result ) ;
138138 t . end ( ) ;
139139} ) ;
140140
141141test ( 'current-file: isCurrentFile' , ( t ) => {
142- const { DOM , CloudCmd} = global ;
142+ const { DOM , CloudCmd} = globalThis ;
143143
144144 const isContainClass = stub ( ) ;
145145
146- global . DOM = getDOM ( {
146+ globalThis . DOM = getDOM ( {
147147 isContainClass,
148148 } ) ;
149149
150- global . CloudCmd = getCloudCmd ( ) ;
150+ globalThis . CloudCmd = getCloudCmd ( ) ;
151151
152152 const current = { } ;
153153 currentFile . isCurrentFile ( current ) ;
154154
155- global . DOM = DOM ;
156- global . CloudCmd = CloudCmd ;
155+ globalThis . DOM = DOM ;
156+ globalThis . CloudCmd = CloudCmd ;
157157
158158 t . calledWith ( isContainClass , [ current , _CURRENT_FILE ] , 'should call isContainClass' ) ;
159159 t . end ( ) ;
160160} ) ;
161161
162162test ( 'current-file: getCurrentType' , ( t ) => {
163- const { DOM , CloudCmd} = global ;
163+ const { DOM , CloudCmd} = globalThis ;
164164
165- global . DOM = getDOM ( ) ;
166- global . CloudCmd = getCloudCmd ( ) ;
165+ globalThis . DOM = getDOM ( ) ;
166+ globalThis . CloudCmd = getCloudCmd ( ) ;
167167
168- const { getByDataName} = global . DOM ;
168+ const { getByDataName} = globalThis . DOM ;
169169
170170 getByDataName . returns ( {
171171 className : 'mini-icon directory' ,
@@ -175,87 +175,87 @@ test('current-file: getCurrentType', (t) => {
175175
176176 currentFile . getCurrentType ( current ) ;
177177
178- global . DOM = DOM ;
179- global . CloudCmd = CloudCmd ;
178+ globalThis . DOM = DOM ;
179+ globalThis . CloudCmd = CloudCmd ;
180180
181181 t . calledWith ( getByDataName , [ 'js-type' , current ] ) ;
182182 t . end ( ) ;
183183} ) ;
184184
185185test ( 'current-file: isCurrentIsDir: getCurrentType' , ( t ) => {
186- const { DOM , CloudCmd} = global ;
186+ const { DOM , CloudCmd} = globalThis ;
187187
188- global . DOM = getDOM ( ) ;
189- global . CloudCmd = getCloudCmd ( ) ;
188+ globalThis . DOM = getDOM ( ) ;
189+ globalThis . CloudCmd = getCloudCmd ( ) ;
190190
191- const { getCurrentType} = global . DOM ;
191+ const { getCurrentType} = globalThis . DOM ;
192192
193193 const current = create ( ) ;
194194
195195 currentFile . isCurrentIsDir ( current ) ;
196196
197- global . DOM = DOM ;
198- global . CloudCmd = CloudCmd ;
197+ globalThis . DOM = DOM ;
198+ globalThis . CloudCmd = CloudCmd ;
199199
200200 t . calledWith ( getCurrentType , [ current ] ) ;
201201 t . end ( ) ;
202202} ) ;
203203
204204test ( 'current-file: isCurrentIsDir: directory' , ( t ) => {
205- const { DOM , CloudCmd} = global ;
205+ const { DOM , CloudCmd} = globalThis ;
206206
207- global . DOM = getDOM ( {
207+ globalThis . DOM = getDOM ( {
208208 getCurrentType : stub ( ) . returns ( 'directory' ) ,
209209 } ) ;
210210
211- global . CloudCmd = getCloudCmd ( ) ;
211+ globalThis . CloudCmd = getCloudCmd ( ) ;
212212
213213 const current = create ( ) ;
214214
215215 const result = currentFile . isCurrentIsDir ( current ) ;
216216
217- global . DOM = DOM ;
218- global . CloudCmd = CloudCmd ;
217+ globalThis . DOM = DOM ;
218+ globalThis . CloudCmd = CloudCmd ;
219219
220220 t . ok ( result ) ;
221221 t . end ( ) ;
222222} ) ;
223223
224224test ( 'current-file: isCurrentIsDir: directory-link' , ( t ) => {
225- const { DOM , CloudCmd} = global ;
225+ const { DOM , CloudCmd} = globalThis ;
226226
227- global . DOM = getDOM ( {
227+ globalThis . DOM = getDOM ( {
228228 getCurrentType : stub ( ) . returns ( 'directory-link' ) ,
229229 } ) ;
230230
231- global . CloudCmd = getCloudCmd ( ) ;
231+ globalThis . CloudCmd = getCloudCmd ( ) ;
232232
233233 const current = create ( ) ;
234234
235235 const result = currentFile . isCurrentIsDir ( current ) ;
236236
237- global . DOM = DOM ;
238- global . CloudCmd = CloudCmd ;
237+ globalThis . DOM = DOM ;
238+ globalThis . CloudCmd = CloudCmd ;
239239
240240 t . ok ( result ) ;
241241 t . end ( ) ;
242242} ) ;
243243
244244test ( 'current-file: isCurrentIsDir: file' , ( t ) => {
245- const { DOM , CloudCmd} = global ;
245+ const { DOM , CloudCmd} = globalThis ;
246246
247- global . DOM = getDOM ( {
247+ globalThis . DOM = getDOM ( {
248248 getCurrentType : stub ( ) . returns ( 'file' ) ,
249249 } ) ;
250250
251- global . CloudCmd = getCloudCmd ( ) ;
251+ globalThis . CloudCmd = getCloudCmd ( ) ;
252252
253253 const current = create ( ) ;
254254
255255 const result = currentFile . isCurrentIsDir ( current ) ;
256256
257- global . DOM = DOM ;
258- global . CloudCmd = CloudCmd ;
257+ globalThis . DOM = DOM ;
258+ globalThis . CloudCmd = CloudCmd ;
259259
260260 t . notOk ( result ) ;
261261 t . end ( ) ;
0 commit comments