File tree 3 files changed +9
-5
lines changed
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 14
14
// See the License for the specific language governing permissions and
15
15
// limitations under the License.
16
16
17
- import { spinner } from 'zx/experimental '
17
+ import { spinner } from 'zx'
18
18
19
19
const tests = await glob ( 'test/*.test.js' )
20
20
await spinner ( 'running tests' , async ( ) => {
Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ function syncCwd() {
556
556
557
557
export function cd ( dir : string | ProcessOutput ) {
558
558
if ( dir instanceof ProcessOutput ) {
559
- dir = dir . toString ( ) . replace ( / \n + $ / , '' )
559
+ dir = dir . toString ( ) . trim ( )
560
560
}
561
561
562
562
$ . log ( { kind : 'cd' , dir } )
Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
15
15
import assert from 'node:assert'
16
- import { test , describe , beforeEach } from 'node:test'
16
+ import { test , describe } from 'node:test'
17
17
import { inspect } from 'node:util'
18
+ import { basename } from 'node:path'
18
19
import { Readable , Writable } from 'node:stream'
19
20
import { Socket } from 'node:net'
20
21
import { ProcessPromise , ProcessOutput } from '../build/index.js'
@@ -297,10 +298,13 @@ describe('core', () => {
297
298
} )
298
299
299
300
test ( 'cd() accepts ProcessOutput in addition to string' , async ( ) => {
300
- within ( async ( ) => {
301
+ await within ( async ( ) => {
301
302
const tmpDir = await $ `mktemp -d`
302
303
cd ( tmpDir )
303
- assert . equal ( process . cwd ( ) , tmpDir . toString ( ) . trimEnd ( ) )
304
+ assert . equal (
305
+ basename ( process . cwd ( ) ) ,
306
+ basename ( tmpDir . toString ( ) . trimEnd ( ) )
307
+ )
304
308
} )
305
309
} )
306
310
You can’t perform that action at this time.
0 commit comments