����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /home/real/node-v13.0.1/deps/npm/test/tap/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/real/node-v13.0.1/deps/npm/test/tap/false-name.js
// this is a test for fix #2538

// the false_name-test-package has the name property 'test-package' set
// in the package.json and a dependency named 'test-package' is also a
// defined dependency of 'test-package-with-one-dep'.
//
// this leads to a conflict during installation and the fix is covered
// by this test

var fs = require('graceful-fs')
var path = require('path')
var existsSync = fs.existsSync || path.existsSync

var mr = require('npm-registry-mock')
var test = require('tap').test

var common = require('../common-tap.js')

var pkg = common.pkg
var cache = common.cache
var server

var EXEC_OPTS = { cwd: pkg }

var indexContent = 'module.exports = true\n'
var json = {
  name: 'test-package',
  version: '0.0.0',
  main: 'index.js',
  dependencies: {
    'test-package-with-one-dep': '0.0.0'
  }
}

test('setup', function (t) {
  t.comment('test for https://github.com/npm/npm/issues/2538')
  setup()
  mr({ port: common.port }, function (er, s) {
    server = s
    t.end()
  })
})

test('not every pkg.name can be required', function (t) {
  common.npm(
    [
      'install', '.',
      '--cache', cache,
      '--registry', common.registry
    ],
    EXEC_OPTS,
    function (err, code) {
      t.ifErr(err, 'install finished without error')
      t.equal(code, 0, 'install exited ok')
      t.ok(
        existsSync(path.join(pkg, 'node_modules', 'test-package-with-one-dep')),
        'test-package-with-one-dep installed OK'
      )
      t.ok(
        existsSync(path.join(pkg, 'node_modules', 'test-package')),
        'test-package subdep installed OK'
      )
      t.end()
    }
  )
})

test('cleanup', function (t) {
  server.close()
  t.end()
})

function setup () {
  fs.writeFileSync(
    path.join(pkg, 'package.json'),
    JSON.stringify(json, null, 2)
  )
  fs.writeFileSync(path.join(pkg, 'index.js'), indexContent)
}

ZeroDay Forums Mini