1 var fs = require('graceful-fs')
2 var path = require('path')
4 var mkdirp = require('mkdirp')
5 var mr = require('npm-registry-mock')
6 var osenv = require('osenv')
7 var rimraf = require('rimraf')
8 var test = require('tap').test
10 var common = require('../common-tap.js')
13 var pkg = path.resolve(__dirname, 'install-cli-unicode')
15 function hasOnlyAscii (s) {
16 return /^[\000-\177]*$/.test(s)
19 var EXEC_OPTS = { cwd: pkg }
23 description: 'fixture',
30 test('setup', function (t) {
34 path.join(pkg, 'package.json'),
35 JSON.stringify(json, null, 2)
38 mr({ port: common.port }, function (er, s) {
44 test('does not use unicode with --unicode false', function (t) {
48 '--registry', common.registry,
49 '--loglevel', 'silent',
53 function (err, code, stdout) {
54 t.ifError(err, 'install package read without unicode success')
55 t.notOk(code, 'npm install exited with code 0')
56 t.ifError(err, 'npm install ran without issue')
57 t.ok(stdout, 'got some output')
58 t.ok(hasOnlyAscii(stdout), 'only ASCII in install output')
65 test('cleanup', function (t) {
67 process.chdir(osenv.tmpdir())