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

split-package-names.js « utils « lib « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c69bb2a3dab8cbe935325a8af5ed53b93c25b66c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict'

const { test } = require('tap')
const splitPackageNames = require('../../../lib/utils/split-package-names.js')

test('splitPackageNames', t => {
  const assertions = [
    ['semver', 'semver'],
    ['read-pkg/semver', 'read-pkg/node_modules/semver'],
    ['@npmcli/one/@npmcli/two', '@npmcli/one/node_modules/@npmcli/two'],
    ['@npmcli/one/semver', '@npmcli/one/node_modules/semver'],
  ]

  for (const [input, expected] of assertions)
    t.equal(splitPackageNames(input), expected, `split ${input} correctly`)
  t.end()
})