mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 14:51:50 +00:00

Contains the following npm releases: - https://github.com/npm/npm/releases/tag/v3.9.6 - https://github.com/npm/npm/releases/tag/v3.10.0 - https://github.com/npm/npm/releases/tag/v3.10.1 - https://github.com/npm/npm/releases/tag/v3.10.2 PR-URL: https://github.com/nodejs/node/pull/7410 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
80 lines
1.6 KiB
JavaScript
80 lines
1.6 KiB
JavaScript
global.FAKE_WINDOWS = true
|
|
|
|
var npa = require('../npa.js')
|
|
var test = require('tap').test
|
|
|
|
var cases = {
|
|
'C:\\x\\y\\z': {
|
|
raw: 'C:\\x\\y\\z',
|
|
scope: null,
|
|
name: null,
|
|
escapedName: null,
|
|
rawSpec: 'C:\\x\\y\\z',
|
|
spec: 'C:\\x\\y\\z',
|
|
type: 'local'
|
|
},
|
|
'foo@C:\\x\\y\\z': {
|
|
raw: 'foo@C:\\x\\y\\z',
|
|
scope: null,
|
|
name: 'foo',
|
|
escapedName: 'foo',
|
|
rawSpec: 'C:\\x\\y\\z',
|
|
spec: 'C:\\x\\y\\z',
|
|
type: 'local'
|
|
},
|
|
'foo@file:///C:\\x\\y\\z': {
|
|
raw: 'foo@file:///C:\\x\\y\\z',
|
|
scope: null,
|
|
name: 'foo',
|
|
escapedName: 'foo',
|
|
rawSpec: 'file:///C:\\x\\y\\z',
|
|
spec: 'C:\\x\\y\\z',
|
|
type: 'local'
|
|
},
|
|
'foo@file://C:\\x\\y\\z': {
|
|
raw: 'foo@file://C:\\x\\y\\z',
|
|
scope: null,
|
|
name: 'foo',
|
|
escapedName: 'foo',
|
|
rawSpec: 'file://C:\\x\\y\\z',
|
|
spec: 'C:\\x\\y\\z',
|
|
type: 'local'
|
|
},
|
|
'file:///C:\\x\\y\\z': {
|
|
raw: 'file:///C:\\x\\y\\z',
|
|
scope: null,
|
|
name: null,
|
|
escapedName: null,
|
|
rawSpec: 'file:///C:\\x\\y\\z',
|
|
spec: 'C:\\x\\y\\z',
|
|
type: 'local'
|
|
},
|
|
'file://C:\\x\\y\\z': {
|
|
raw: 'file://C:\\x\\y\\z',
|
|
scope: null,
|
|
name: null,
|
|
escapedName: null,
|
|
rawSpec: 'file://C:\\x\\y\\z',
|
|
spec: 'C:\\x\\y\\z',
|
|
type: 'local'
|
|
},
|
|
'foo@/foo/bar/baz': {
|
|
raw: 'foo@/foo/bar/baz',
|
|
scope: null,
|
|
name: 'foo',
|
|
escapedName: 'foo',
|
|
rawSpec: '/foo/bar/baz',
|
|
spec: '/foo/bar/baz',
|
|
type: 'local'
|
|
}
|
|
}
|
|
|
|
test('parse a windows path', function (t) {
|
|
Object.keys(cases).forEach(function (c) {
|
|
var expect = cases[c]
|
|
var actual = npa(c)
|
|
t.same(actual, expect, c)
|
|
})
|
|
t.end()
|
|
})
|