���� 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 : /proc/self/root/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 json = { author: 'John Foo', name: 'bad-dep-format', version: '0.0.0', dependencies: { 'not-legit': 'bad:[email protected]' } } test('invalid url format returns appropriate error', function (t) { setup(json) common.npm(['install'], {}, function (err, code, stdout, stderr) { t.ifError(err, 'install ran without error') t.equals(code, 1, 'install exited with code 1') t.match(stderr, /ERR.*Unsupported URL Type/, 'Error should report that invalid url-style formats are used') t.end() }) }) test('cleanup', function (t) { cleanup() t.end() }) function setup (json) { cleanup() process.chdir(mkPkg(json)) } function cleanup () { process.chdir(osenv.tmpdir()) var pkgs = [json] pkgs.forEach(function (json) { rimraf.sync(path.resolve(common.pkg, json.name)) }) } function mkPkg (json) { var pkgPath = path.resolve(common.pkg, json.name) mkdirp.sync(pkgPath) fs.writeFileSync( path.join(pkgPath, 'package.json'), JSON.stringify(json, null, 2) ) return pkgPath }