Skip to content

Commit 58159ca

Browse files
committed
test: cwd can be a url
1 parent a547a9c commit 58159ca

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/url-cwd.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import t from 'tap'
2+
import {pathToFileURL} from 'url'
3+
import {Glob} from '../'
4+
5+
t.test('can use file url as cwd option', t => {
6+
const fileURL = pathToFileURL(process.cwd())
7+
const fileURLString = String(fileURL)
8+
const ps = new Glob('.', { cwd: process.cwd()})
9+
const pu = new Glob('.', { cwd: fileURL })
10+
const pus = new Glob('.', { cwd: fileURLString })
11+
t.equal(ps.cwd, process.cwd())
12+
t.equal(pu.cwd, process.cwd())
13+
t.equal(pus.cwd, process.cwd())
14+
t.end()
15+
})

0 commit comments

Comments
 (0)