���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() 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/ |
var fs = require('graceful-fs') var path = require('path') var mkdirp = require('mkdirp') var osenv = require('osenv') var rimraf = require('rimraf') var test = require('tap').test var common = require('../common-tap.js') var pkg = common.pkg var EXEC_OPTS = { cwd: pkg, stdio: [0, 1, 2] } var json = { name: 'install-at-locally-mock', version: '0.0.0' } test('setup', function (t) { cleanup() t.end() }) test('\'npm install ./[email protected]\' should install local pkg', function (t) { var target = './[email protected]' setup(target) common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { if (err) throw err var p = path.resolve(pkg, 'node_modules/install-at-locally-mock/package.json') t.equal(code, 0, 'npm install exited with code') t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) t.end() }) }) test('\'npm install install/at/locally@./[email protected]\' should install local pkg', function (t) { var target = 'install/at/locally@./[email protected]' setup(target) common.npm(['install', target], EXEC_OPTS, function (err, code) { if (err) throw err var p = path.resolve(pkg, 'node_modules/install-at-locally-mock/package.json') t.equal(code, 0, 'npm install exited with code') t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) t.end() }) }) test('cleanup', function (t) { cleanup() t.end() }) function cleanup () { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) } function setup (target) { cleanup() var root = path.resolve(pkg, target) mkdirp.sync(root) fs.writeFileSync( path.join(root, 'package.json'), JSON.stringify(json, null, 2) ) mkdirp.sync(path.resolve(pkg, 'node_modules')) process.chdir(pkg) }