����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/shrinkwrap-resolve-conflict.js
'use strict'

const BB = require('bluebird')

const common = require('../common-tap.js')
const fs = BB.promisifyAll(require('fs'))
const path = require('path')
const rimraf = BB.promisify(require('rimraf'))
const test = require('tap').test
const Tacks = require('tacks')

const File = Tacks.File
const Dir = Tacks.Dir

const testDir = common.pkg
const modAdir = path.resolve(testDir, 'modA')
const modBdir = path.resolve(testDir, 'modB')
const modCdir = path.resolve(testDir, 'modC')

test('conflicts in shrinkwrap are auto-resolved on install', (t) => {
  const fixture = new Tacks(Dir({
    'package.json': File({
      name: 'foo',
      dependencies: {
        modA: 'file://' + modAdir,
        modB: 'file://' + modBdir
      },
      devDependencies: {
        modC: 'file://' + modCdir
      }
    }),
    'npm-shrinkwrap.json': File(
      `
{
  "name": "foo",
  "requires": true,
  "lockfileVersion": 1,
  "dependencies": {
<<` + `<<` + `<<` + `< HEAD
    "modA": {
      "version": "file:modA"
||` + `||` + `||` + `| merged common ancestors
    "modB": {
      "version": "file:modB"
==` + `==` + `==` + `=
    "modC": {
      "version": "file:modC",
      "dev": true
>>` + `>>` + `>>` + `> branch
    }
  }
}
`),
    'modA': Dir({
      'package.json': File({
        name: 'modA',
        version: '1.0.0'
      })
    }),
    'modB': Dir({
      'package.json': File({
        name: 'modB',
        version: '1.0.0'
      })
    }),
    'modC': Dir({
      'package.json': File({
        name: 'modC',
        version: '1.0.0'
      })
    })
  }))
  fixture.create(testDir)
  function readJson (file) {
    return fs.readFileAsync(path.join(testDir, file)).then(JSON.parse)
  }
  return BB.fromNode((cb) => {
    common.npm([
      'install',
      '--loglevel', 'warn'
    ], {cwd: testDir}, (err, code, out, stderr) => {
      t.comment(stderr)
      t.match(stderr, /warn.*conflict/gi, 'warns about a conflict')
      cb(err || (code && new Error('non-zero exit code')) || null, out)
    })
  })
    .then(() => BB.join(
      readJson('npm-shrinkwrap.json'),
      readJson('node_modules/modA/package.json'),
      readJson('node_modules/modB/package.json'),
      readJson('node_modules/modC/package.json'),
      (lockfile, A, B, C) => {
        t.deepEqual(lockfile, {
          name: 'foo',
          requires: true,
          lockfileVersion: 1,
          dependencies: {
            modA: {
              version: 'file:modA'
            },
            modB: {
              version: 'file:modB'
            },
            modC: {
              version: 'file:modC',
              dev: true
            }
          }
        }, 'resolved lockfile matches expectations')
        t.equal(A.name, 'modA', 'installed modA')
        t.equal(B.name, 'modB', 'installed modB')
        t.equal(C.name, 'modC', 'installed modC')
      }
    ))
})

test('cleanup', () => rimraf(testDir))

ZeroDay Forums Mini