����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 :  /proc/self/root/home/real/node-v13.0.1/deps/npm/test/tap/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/home/real/node-v13.0.1/deps/npm/test/tap/ci-with-local-dependency.js
const fs = require('graceful-fs')
const path = require('path')

const mkdirp = require('mkdirp')
const t = require('tap')

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

const pkg = common.pkg + '/package'

const EXEC_OPTS = {
  cwd: pkg,
  stdio: [0, 1, 2],
  env: common.newEnv().extend({
    npm_config_registry: common.registry
  })
}

const localDependencyJson = {
  name: 'local-dependency',
  version: '0.0.0',
  dependencies: {
    'test-package': '0.0.0'
  }
}

const dependentJson = {
  name: 'dependent',
  version: '0.0.0',
  dependencies: {
    'local-dependency': '../local-dependency'
  }
}

const target = path.resolve(pkg, '../local-dependency')
const mr = require('npm-registry-mock')
let server
t.teardown(() => {
  if (server) {
    server.close()
  }
})

t.test('setup', function (t) {
  mkdirp.sync(target)
  fs.writeFileSync(
    path.join(target, 'package.json'),
    JSON.stringify(localDependencyJson, null, 2)
  )
  mkdirp.sync(pkg)
  fs.writeFileSync(
    path.join(pkg, 'package.json'),
    JSON.stringify(dependentJson, null, 2)
  )
  mr({ port: common.port }, (er, s) => {
    if (er) {
      throw er
    }
    server = s
    t.end()
  })
})

t.test('\'npm install\' should install local pkg from sub path', function (t) {
  common.npm(['install', '--loglevel=silent'], EXEC_OPTS, function (err, code) {
    if (err) throw err
    t.equal(code, 0, 'npm install exited with code')
    t.ok(fs.statSync(path.resolve(pkg, 'node_modules/local-dependency/package.json')).isFile(), 'local dependency package.json exists')
    t.ok(fs.statSync(path.resolve(pkg, 'node_modules/local-dependency/node_modules/test-package')).isDirectory(), 'transitive dependency installed')
    t.end()
  })
})

t.test('\'npm ci\' should work', function (t) {
  common.npm(['ci', '--loglevel=silent'], EXEC_OPTS, function (err, code) {
    if (err) throw err
    t.equal(code, 0, 'npm install exited with code')
    t.ok(fs.statSync(path.resolve(pkg, 'node_modules/local-dependency/package.json')).isFile(), 'local dependency package.json exists')
    t.ok(fs.statSync(path.resolve(pkg, 'node_modules/local-dependency/node_modules/test-package')).isDirectory(), 'transitive dependency installed')
    t.end()
  })
})

ZeroDay Forums Mini