HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/douven.komma.pro/node_modules/npm/test/tap/install-local-dep-cycle.js
'use strict'
var path = require('path')
var fs = require('graceful-fs')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var test = require('tap').test
var common = require('../common-tap.js')

var base = path.join(__dirname, path.basename(__filename, '.js'))

var baseJSON = {
  name: 'base',
  version: '1.0.0',
  dependencies: {
    a: 'file:a/',
    b: 'file:b/'
  }
}

var aPath = path.join(base, 'a')
var aJSON = {
  name: 'a',
  version: '1.0.0',
  dependencies: {
    b: 'file:../b',
    c: 'file:../c'
  }
}

var bPath = path.join(base, 'b')
var bJSON = {
  name: 'b',
  version: '1.0.0'
}

var cPath = path.join(base, 'c')
var cJSON = {
  name: 'c',
  version: '1.0.0',
  dependencies: {
    b: 'file:../b'
  }
}

test('setup', function (t) {
  cleanup()
  setup()
  t.end()
})

test('install', function (t) {
  common.npm(['install'], {cwd: base}, function (er, code, stdout, stderr) {
    t.ifError(er, 'npm config ran without issue')
    t.is(code, 0, 'exited with a non-error code')
    t.is(stderr, '', 'Ran without errors')
    t.end()
  })
})

test('cleanup', function (t) {
  cleanup()
  t.end()
})

function saveJson (pkgPath, json) {
  mkdirp.sync(pkgPath)
  fs.writeFileSync(path.join(pkgPath, 'package.json'), JSON.stringify(json, null, 2))
}

function setup () {
  saveJson(base, baseJSON)
  saveJson(aPath, aJSON)
  saveJson(bPath, bJSON)
  saveJson(cPath, cJSON)
}

function cleanup () {
  rimraf.sync(base)
}