File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export const $: Shell & Options = new Proxy<Shell & Options>(
191
191
} ,
192
192
}
193
193
)
194
- $ . cwdHook = true
194
+ $ . cwdHook = false
195
195
try {
196
196
setupBash ( )
197
197
} catch ( err ) { }
Original file line number Diff line number Diff line change @@ -233,10 +233,11 @@ describe('core', () => {
233
233
} )
234
234
235
235
test ( '$.cwdHook is configurable' , ( ) => {
236
- $ . cwdHook = false
237
- assert . equal ( $ . cwdHook , false )
238
236
$ . cwdHook = true
239
237
assert . equal ( $ . cwdHook , true )
238
+
239
+ $ . cwdHook = false
240
+ assert . equal ( $ . cwdHook , false )
240
241
} )
241
242
242
243
test ( 'cd() works with relative paths' , async ( ) => {
@@ -270,7 +271,8 @@ describe('core', () => {
270
271
}
271
272
} )
272
273
273
- test ( 'cd() does not affect parallel contexts' , async ( ) => {
274
+ test ( 'cd() does not affect parallel contexts ($.cwdHook enabled)' , async ( ) => {
275
+ $ . cwdHook = true
274
276
const cwd = process . cwd ( )
275
277
try {
276
278
fs . mkdirpSync ( '/tmp/zx-cd-parallel/one/two' )
@@ -304,6 +306,7 @@ describe('core', () => {
304
306
} finally {
305
307
fs . rmSync ( '/tmp/zx-cd-parallel' , { recursive : true } )
306
308
cd ( cwd )
309
+ $ . cwdHook = false
307
310
}
308
311
} )
309
312
You can’t perform that action at this time.
0 commit comments