Welcome to mirror list, hosted at ThFree Co, Russian Federation.

path.js « utils « lib « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0a7846d94bc67cff597e5975e788c09cbe20a533 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const t = require('tap')
const mod = '../../../lib/utils/path.js'
const delim = require('../../../lib/utils/is-windows.js') ? ';' : ':'
Object.defineProperty(process, 'env', {
  value: {},
})
process.env.path = ['foo', 'bar', 'baz'].join(delim)
t.strictSame(t.mock(mod), ['foo', 'bar', 'baz'])
process.env.Path = ['a', 'b', 'c'].join(delim)
t.strictSame(t.mock(mod), ['a', 'b', 'c'])
process.env.PATH = ['x', 'y', 'z'].join(delim)
t.strictSame(t.mock(mod), ['x', 'y', 'z'])