summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/unit-child-path.js
blob: 902e8f5ec7483a4a3706e9d13bba2e8a9f6f1243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict'
var test = require('tap').test
var childPath = require('../../lib/utils/child-path.js')
var path = require('path')

test('childPath', function (t) {
  t.is(
    path.resolve(childPath('/path/to', {name: 'abc'})),
    path.resolve('/path/to/node_modules/abc'),
    'basic use')
  t.is(
    path.resolve(childPath('/path/to', {package: {name: '@zed/abc'}})),
    path.resolve('/path/to/node_modules/@zed/abc'),
    'scoped use')
  t.end()
})