����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/publish-scoped.js
var fs = require('fs')
var path = require('path')

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

var pkg = common.pkg

var server

function setup () {
  fs.writeFileSync(
    path.join(pkg, 'package.json'),
    JSON.stringify({
      name: '@bigco/publish-organized',
      version: '1.2.5'
    }, null, 2),
    'ascii')
}

test('setup', function (t) {
  setup()
  mr({port: common.port, throwOnUnmatched: true}, function (err, s) {
    t.ifError(err, 'registry mocked successfully')
    server = s
    t.end()
  })
})

test('npm publish should honor scoping', function (t) {
  server.filteringRequestBody(verify)
    .put('/@bigco%2fpublish-organized', true)
    .reply(201, {ok: true})

  var configuration = [
    'progress=false',
    'cache=' + common.cache,
    'registry=http://nonexistent.lvh.me',
    '//localhost:' + common.port + '/:username=username',
    '//localhost:' + common.port + '/:_password=' + Buffer.from('password').toString('base64'),
    '//localhost:' + common.port + '/:email=' + '[email protected]',
    '@bigco:registry=' + common.registry
  ]
  var configFile = path.join(pkg, '.npmrc')

  fs.writeFileSync(configFile, configuration.join('\n') + '\n')

  common.npm(['publish'], {'cwd': pkg}, function (err, code, stdout, stderr) {
    if (err) throw err
    t.is(code, 0, 'published without error')
    server.done()
    t.end()
  })

  function verify (body) {
    t.doesNotThrow(function () {
      var parsed = JSON.parse(body)
      var current = parsed.versions['1.2.5']
      t.equal(
        current._npmVersion,
        require(path.resolve(__dirname, '../../package.json')).version,
        'npm version is correct'
      )

      t.equal(
        current._nodeVersion,
        process.versions.node,
        'node version is correct'
      )
    }, 'converted body back into object')

    return true
  }
})

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

ZeroDay Forums Mini