Skip to content

Commit

Permalink
test: cwd can be a url
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 27, 2023
1 parent a547a9c commit 58159ca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/url-cwd.ts
@@ -0,0 +1,15 @@
import t from 'tap'
import {pathToFileURL} from 'url'
import {Glob} from '../'

t.test('can use file url as cwd option', t => {
const fileURL = pathToFileURL(process.cwd())
const fileURLString = String(fileURL)
const ps = new Glob('.', { cwd: process.cwd()})
const pu = new Glob('.', { cwd: fileURL })
const pus = new Glob('.', { cwd: fileURLString })
t.equal(ps.cwd, process.cwd())
t.equal(pu.cwd, process.cwd())
t.equal(pus.cwd, process.cwd())
t.end()
})

0 comments on commit 58159ca

Please sign in to comment.