����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/dedupe-git-semver.js
'use strict'
const fs = require('fs')
const path = require('path')
const test = require('tap').test
const requireInject = require('require-inject')
const Tacks = require('tacks')
const File = Tacks.File
const Dir = Tacks.Dir

const manifests = {
  'git-wrap': {
    name: 'git-wrap',
    version: '1.0.0',
    dependencies: {
      git: 'git+https://example.com/git#semver:1.0'
    }
  },
  git: {
    name: 'git',
    version: '1.0.0'
  }
}

const npm = requireInject.installGlobally('../../lib/npm.js', {
  pacote: {
    manifest: function (spec) {
      const manifest = manifests[spec.name]
      manifest._requested = spec
      manifest._resolved = spec.saveSpec.replace(/^file:/, '').replace(/(:?#.*)$/, '#0000000000000000000000000000000000000000')
      manifest._from = spec.rawSpec
      return Promise.resolve(manifest)
    }
  },
  '../../lib/utils/output.js': function () {
    // do not output to stdout
  }
})

const common = require('../common-tap.js')
const basedir = common.pkg
const testdir = path.join(basedir, 'testdir')
const cachedir = common.cache
const tmpdir = path.join(basedir, 'tmp')

const cwd = process.cwd()

const conf = {
  cache: cachedir,
  tmp: tmpdir,
  loglevel: 'silent',
  'package-lock-only': true
}

const fixture = new Tacks(Dir({
  cache: Dir(),
  global: Dir(),
  tmp: Dir(),
  testdir: Dir({
    'package.json': File({
      name: 'fixture',
      version: '1.0.0',
      dependencies: {
        git: 'git+https://example.com/git#semver:1',
        'git-wrap': 'file:git-wrap-1.0.0.tgz'
      }
    }),
    // Tarball source:
    // 'git-wrap': Dir({
    //   'package.json': File({
    //     name: 'git-wrap',
    //     version: '1.0.0',
    //     dependencies: {
    //       git: 'git+https://example.com/git#semver:1.0'
    //     }
    //   })
    // }),
    'git-wrap-1.0.0.tgz': File(Buffer.from(
      '1f8b0800000000000003ed8fcd0ac23010843df729423caaf9c13642df26' +
      'b44bad9a3434f107a4efeec68aa7de2c8898ef32cb0c3bec3a5d1d7503dc' +
      '8dca0ebeb38b991142a83c27537e44ee30db164a48a994c01987a210a873' +
      '1f32c5d907dde3299ff68cbf90b7fe08f78c106ab5015a12dab46173edb5' +
      'a3ebe85ea0f76d676320996062746b70606bb0550b1ea3b84f9e9baf82d5' +
      '3e04e74bcee1a68d3b01ab3ac3d15f7a30d8586215c59d211bb26fff9e48' +
      '2412ffcc034458283d00080000',
      'hex'
    ))
  })
}))

function setup () {
  cleanup()
  fixture.create(basedir)
}

function cleanup () {
  fixture.remove(basedir)
}

test('setup', function (t) {
  setup()
  process.chdir(testdir)
  npm.load(conf, function (err) {
    if (err) throw err
    t.done()
  })
})

test('dedupe matching git semver ranges', function (t) {
  npm.commands.install(function (err) {
    if (err) throw err
    const packageLock = JSON.parse(fs.readFileSync('package-lock.json'))
    t.same(packageLock, {
      name: 'fixture',
      version: '1.0.0',
      lockfileVersion: 1,
      requires: true,
      dependencies: {
        git: {
          from: 'git+https://example.com/git#semver:1',
          version: 'git+https://example.com/git#0000000000000000000000000000000000000000'
        },
        'git-wrap': {
          version: 'file:git-wrap-1.0.0.tgz',
          requires: {
            git: 'git+https://example.com/git#semver:1'
          }
        }
      }
    })
    t.done()
  })
})

test('cleanup', function (t) {
  process.chdir(cwd)
  cleanup()
  t.done()
})

ZeroDay Forums Mini