diff options
Diffstat (limited to 'node_modules/init-package-json')
22 files changed, 41 insertions, 590 deletions
diff --git a/node_modules/init-package-json/.npmignore b/node_modules/init-package-json/.npmignore deleted file mode 100644 index 44a3be18e..000000000 --- a/node_modules/init-package-json/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -.eslintrc diff --git a/node_modules/init-package-json/.travis.yml b/node_modules/init-package-json/.travis.yml deleted file mode 100644 index 991d04b6e..000000000 --- a/node_modules/init-package-json/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - 'iojs' diff --git a/node_modules/init-package-json/default-input.js b/node_modules/init-package-json/default-input.js index 4110bac98..f24fa5d32 100644 --- a/node_modules/init-package-json/default-input.js +++ b/node_modules/init-package-json/default-input.js @@ -15,6 +15,10 @@ function niceName (n) { return n.replace(/^node-|[.-]js$/g, '').toLowerCase() } +function conf (name) { + return config.get(name) || config.get(name.split('.').join('-')) +} + function readDeps (test, excluded) { return function (cb) { fs.readdir('node_modules', function (er, dir) { if (er) return cb() @@ -35,7 +39,7 @@ function readDeps (test, excluded) { return function (cb) { if (p._requiredBy) { if (!p._requiredBy.some(function (req) { return req === '#USER' })) return next() } - deps[d] = config.get('save-exact') ? p.version : config.get('save-prefix') + p.version + deps[d] = conf('save.exact') ? p.version : conf('save.prefix') + p.version return next() }) }) @@ -47,7 +51,7 @@ function readDeps (test, excluded) { return function (cb) { var name = package.name || basename var spec = npa(name) -var scope = config.get('scope') +var scope = conf('scope') if (scope) { if (scope.charAt(0) !== '@') scope = '@' + scope if (spec.scope) { @@ -56,7 +60,7 @@ if (scope) { name = scope + '/' + name } } -exports.name = yes ? name : prompt('name', name, function (data) { +exports.name = yes ? name : prompt('package name', niceName(name), function (data) { var its = validateName(data) if (its.validForNewPackages) return data var errors = (its.errors || []).concat(its.warnings || []) @@ -65,10 +69,7 @@ exports.name = yes ? name : prompt('name', name, function (data) { return er }) -var version = package.version || - config.get('init.version') || - config.get('init-version') || - '1.0.0' +var version = package.version || conf('init.version') || '1.0.0' exports.version = yes ? version : prompt('version', version, function (version) { @@ -129,6 +130,7 @@ exports.directories = function (cb) { case 'test': case 'tests': return res.test = d case 'doc': case 'docs': return res.doc = d case 'man': return res.man = d + case 'lib': return res.lib = d } }) if (Object.keys(res).length === 0) res = undefined @@ -211,23 +213,15 @@ if (!package.keywords) { } if (!package.author) { - exports.author = config.get('init.author.name') || - config.get('init-author-name') - ? { - "name" : config.get('init.author.name') || - config.get('init-author-name'), - "email" : config.get('init.author.email') || - config.get('init-author-email'), - "url" : config.get('init.author.url') || - config.get('init-author-url') - } - : yes ? '' : prompt('author') + var a = conf('init.author.name') + exports.author = a ? { + "name": a, + "email": conf('init.author.email'), + "url": conf('init.author.url') + } : yes ? '' : prompt('author') } -var license = package.license || - config.get('init.license') || - config.get('init-license') || - 'ISC' +var license = package.license || conf('init.license') || 'ISC' exports.license = yes ? license : prompt('license', license, function (data) { var its = validateLicense(data) if (its.validForNewPackages) return data diff --git a/node_modules/init-package-json/example/example-basic.js b/node_modules/init-package-json/example/example-basic.js deleted file mode 100644 index 0d13bda06..000000000 --- a/node_modules/init-package-json/example/example-basic.js +++ /dev/null @@ -1,7 +0,0 @@ -var init = require('../init-package-json.js') -var dir = process.cwd() -var initFile = require.resolve('./init/basic-init.js') - -init(dir, initFile, function (err, data) { - if (!err) console.log('written successfully') -}) diff --git a/node_modules/init-package-json/example/example-default.js b/node_modules/init-package-json/example/example-default.js deleted file mode 100644 index 29a819906..000000000 --- a/node_modules/init-package-json/example/example-default.js +++ /dev/null @@ -1,6 +0,0 @@ -var init = require('../init-package-json.js') -var dir = process.cwd() - -init(dir, 'file that does not exist', function (err, data) { - if (!err) console.log('written successfully') -}) diff --git a/node_modules/init-package-json/example/example-npm.js b/node_modules/init-package-json/example/example-npm.js deleted file mode 100644 index 292da6a7a..000000000 --- a/node_modules/init-package-json/example/example-npm.js +++ /dev/null @@ -1,11 +0,0 @@ -var init = require('../init-package-json.js') -var dir = process.cwd() -var npm = require('npm') - -npm.load(function (er, npm) { - if (er) throw er - init(dir, npm.config.get('init-module'), npm.config, function (er, data) { - if (er) throw er - console.log('written successfully') - }) -}) diff --git a/node_modules/init-package-json/example/init/basic-init.js b/node_modules/init-package-json/example/init/basic-init.js deleted file mode 100644 index c8615cc10..000000000 --- a/node_modules/init-package-json/example/init/basic-init.js +++ /dev/null @@ -1 +0,0 @@ -exports.flavor = prompt("what's your favorite flavor of ice cream buddy?", "I LIKE THEM ALL")
\ No newline at end of file diff --git a/node_modules/init-package-json/init-package-json.js b/node_modules/init-package-json/init-package-json.js index 7dc4b0a39..31758281d 100644 --- a/node_modules/init-package-json/init-package-json.js +++ b/node_modules/init-package-json/init-package-json.js @@ -117,6 +117,9 @@ function init (dir, input, config, cb) { } console.log('About to write to %s:\n\n%s\n', packageFile, d) read({prompt:'Is this ok? ', default: 'yes'}, function (er, ok) { + if (er) { + return cb(er) + } if (!ok || ok.toLowerCase().charAt(0) !== 'y') { console.log('Aborted.') } else { diff --git a/node_modules/init-package-json/package.json b/node_modules/init-package-json/package.json index cf4adb461..fd144a3f2 100644 --- a/node_modules/init-package-json/package.json +++ b/node_modules/init-package-json/package.json @@ -2,25 +2,25 @@ "_args": [ [ { - "raw": "init-package-json@1.9.6", + "raw": "init-package-json@1.10.0", "scope": null, "escapedName": "init-package-json", "name": "init-package-json", - "rawSpec": "1.9.6", - "spec": "1.9.6", + "rawSpec": "1.10.0", + "spec": "1.10.0", "type": "version" }, "/Users/rebecca/code/npm" ] ], - "_from": "init-package-json@1.9.6", - "_id": "init-package-json@1.9.6", + "_from": "init-package-json@1.10.0", + "_id": "init-package-json@1.10.0", "_inCache": true, "_location": "/init-package-json", - "_nodeVersion": "7.7.4", + "_nodeVersion": "4.6.1", "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/init-package-json-1.9.6.tgz_1492135231749_0.8497632052749395" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/init-package-json-1.10.0.tgz_1492732545609_0.08608654444105923" }, "_npmUser": { "name": "iarna", @@ -31,22 +31,22 @@ "read": "1.0.7" }, "_requested": { - "raw": "init-package-json@1.9.6", + "raw": "init-package-json@1.10.0", "scope": null, "escapedName": "init-package-json", "name": "init-package-json", - "rawSpec": "1.9.6", - "spec": "1.9.6", + "rawSpec": "1.10.0", + "spec": "1.10.0", "type": "version" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.6.tgz", - "_shasum": "789fc2b74466a4952b9ea77c0575bc78ebd60a61", + "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.0.tgz", + "_shasum": "e8fc7c407a29bbf6d9aab522d103b9fbbafba5b6", "_shrinkwrap": null, - "_spec": "init-package-json@1.9.6", + "_spec": "init-package-json@1.10.0", "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", @@ -75,10 +75,14 @@ }, "directories": {}, "dist": { - "shasum": "789fc2b74466a4952b9ea77c0575bc78ebd60a61", - "tarball": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.6.tgz" + "shasum": "e8fc7c407a29bbf6d9aab522d103b9fbbafba5b6", + "tarball": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.0.tgz" }, - "gitHead": "bcc338ef166aee58fc843c52b5225363d4668bf2", + "files": [ + "default-input.js", + "init-package-json.js" + ], + "gitHead": "08d1575cf2c2adae894980fca7df021fb44565f9", "homepage": "https://github.com/npm/init-package-json#readme", "keywords": [ "init", @@ -121,5 +125,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "1.9.6" + "version": "1.10.0" } diff --git a/node_modules/init-package-json/test/basic.input b/node_modules/init-package-json/test/basic.input deleted file mode 100644 index ca309e922..000000000 --- a/node_modules/init-package-json/test/basic.input +++ /dev/null @@ -1,15 +0,0 @@ -var assert = require('assert') - -exports.name = prompt('name', package.name || basename) -exports.version = '1.2.5' -exports.description = prompt('description', package.description) -exports.author = 'npmbot <n@p.m> (http://npm.im)' -exports.scripts = package.scripts || {} -exports.scripts.test = 'make test' -exports.main = package.main || 'main.js' -exports.config = JSON.parse(JSON.stringify(config)) -try {delete exports.config.config}catch(e){} -try {delete exports.package.config}catch(e){} -try {delete exports.package.package}catch(e){} -try {delete exports.config.package}catch(e){} -exports.package = JSON.parse(JSON.stringify(package)) diff --git a/node_modules/init-package-json/test/basic.js b/node_modules/init-package-json/test/basic.js deleted file mode 100644 index d67e0c3b1..000000000 --- a/node_modules/init-package-json/test/basic.js +++ /dev/null @@ -1,35 +0,0 @@ -var common = require('./lib/common') -var init = require('../') -var path = require('path') -var rimraf = require('rimraf') -var test = require('tap').test - -test('the basics', function (t) { - var i = path.join(__dirname, 'basic.input') - rimraf.sync(__dirname + '/package.json') - init(__dirname, i, { foo: 'bar' }, function (er, data) { - if (er) throw er - var expect = { - name: 'the-name', - version: '1.2.5', - description: 'description', - author: 'npmbot <n@p.m> (http://npm.im)', - scripts: { test: 'make test' }, - main: 'main.js', - config: { foo: 'bar' }, - package: {} - } - console.log('') - t.same(data, expect) - t.end() - }) - common.drive([ - 'the-name\n', - 'description\n', - 'yes\n' - ]) -}) - -test('teardown', function (t) { - rimraf(__dirname + '/package.json', t.end.bind(t)) -}) diff --git a/node_modules/init-package-json/test/dependencies.js b/node_modules/init-package-json/test/dependencies.js deleted file mode 100644 index a53f46a64..000000000 --- a/node_modules/init-package-json/test/dependencies.js +++ /dev/null @@ -1,60 +0,0 @@ -var tap = require('tap') -var init = require('../') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var fs = require('fs') - -var EXPECT = { - name: 'test-deps', - version: '1.0.0', - description: '', - author: '', - scripts: { test: 'mocha' }, - main: 'index.js', - keywords: [], - license: 'ISC', - dependencies: { - 'tap': '*' - }, - devDependencies: { - 'mocha': '^1.0.0' - } -} - -var origwd = process.cwd() -var testdir = path.resolve(__dirname, 'test-deps') -mkdirp.sync(testdir) -process.chdir(testdir) - -fs.writeFileSync(path.resolve(testdir, 'package.json'), JSON.stringify({ - dependencies: { - 'tap': '*' - } -})) - -var fakedeps = ['mocha', 'tap', 'async', 'foobar'] - -fakedeps.forEach(function(dep) { - var depdir = path.resolve(testdir, 'node_modules', dep) - mkdirp.sync(depdir) - - fs.writeFileSync(path.resolve(depdir, 'package.json'), JSON.stringify({ - name: dep, - version: '1.0.0' - })) -}) - -tap.test('read in dependencies and dev deps', function (t) { - init(testdir, testdir, {yes: 'yes', 'save-prefix': '^'}, function (er, data) { - if (er) throw er - - t.same(data, EXPECT, 'used the correct dependency information') - t.end() - }) -}) - -tap.test('teardown', function (t) { - process.chdir(origwd) - rimraf(testdir, t.end.bind(t)) -}) diff --git a/node_modules/init-package-json/test/lib/common.js b/node_modules/init-package-json/test/lib/common.js deleted file mode 100644 index de45089f9..000000000 --- a/node_modules/init-package-json/test/lib/common.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports.drive = drive - -var semver = require('semver') - -function drive (input) { - var stdin = process.stdin - function emit (chunk, ms) { - setTimeout(function () { - stdin.emit('data', chunk) - }, ms) - } - if (semver.gte(process.versions.node, '0.11.0')) { - input.forEach(function (chunk) { - stdin.push(chunk) - }) - } else { - stdin.once('readable', function () { - var ms = 0 - input.forEach(function (chunk) { - emit(chunk, ms += 50) - }) - }) - } -} diff --git a/node_modules/init-package-json/test/license.js b/node_modules/init-package-json/test/license.js deleted file mode 100644 index 8d8ae93dd..000000000 --- a/node_modules/init-package-json/test/license.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tap').test -var init = require('../') -var rimraf = require('rimraf') -var common = require('./lib/common') - -test('license', function (t) { - init(__dirname, '', {}, function (er, data) { - if (er) - throw er - - var wanted = { - name: 'the-name', - version: '1.0.0', - description: '', - scripts: { test: 'echo "Error: no test specified" && exit 1' }, - license: 'Apache-2.0', - author: '', - main: 'basic.js' - } - console.log('') - t.has(data, wanted) - t.end() - }) - common.drive([ - 'the-name\n', - '\n', - '\n', - '\n', - '\n', - '\n', - '\n', - '\n', - 'Apache\n', - 'Apache-2.0\n', - 'yes\n' - ]) -}) - -test('teardown', function (t) { - rimraf(__dirname + '/package.json', t.end.bind(t)) -}) diff --git a/node_modules/init-package-json/test/name-spaces.js b/node_modules/init-package-json/test/name-spaces.js deleted file mode 100644 index a395afb9a..000000000 --- a/node_modules/init-package-json/test/name-spaces.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tap').test -var init = require('../') -var rimraf = require('rimraf') -var common = require('./lib/common') - -test('spaces', function (t) { - rimraf.sync(__dirname + '/package.json') - init(__dirname, '', {}, function (er, data) { - if (er) - throw er - var wanted = { - name: 'the-name', - version: '1.0.0', - description: '', - scripts: { test: 'echo "Error: no test specified" && exit 1' }, - license: 'ISC', - author: '', - main: 'basic.js' - } - console.log('') - t.has(data, wanted) - t.end() - }) - common.drive([ - 'the name\n', - 'the-name\n', - '\n', - '\n', - '\n', - '\n', - '\n', - '\n', - '\n', - '\n', - 'yes\n' - ]) -}) - -test('teardown', function (t) { - rimraf(__dirname + '/package.json', t.end.bind(t)) -}) diff --git a/node_modules/init-package-json/test/name-uppercase.js b/node_modules/init-package-json/test/name-uppercase.js deleted file mode 100644 index d1623260a..000000000 --- a/node_modules/init-package-json/test/name-uppercase.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tap').test -var init = require('../') -var rimraf = require('rimraf') -var common = require('./lib/common') - -test('uppercase', function (t) { - init(__dirname, '', {}, function (er, data) { - if (er) - throw er - - var wanted = { - name: 'the-name', - version: '1.0.0', - description: '', - scripts: { test: 'echo "Error: no test specified" && exit 1' }, - license: 'ISC', - author: '', - main: 'basic.js' - } - console.log('') - t.has(data, wanted) - t.end() - }) - common.drive([ - 'THE-NAME\n', - 'the-name\n', - '\n', - '\n', - '\n', - '\n', - '\n', - '\n', - '\n', - '\n', - 'yes\n' - ]) -}) - -test('teardown', function (t) { - rimraf(__dirname + '/package.json', t.end.bind(t)) -}) diff --git a/node_modules/init-package-json/test/npm-defaults.js b/node_modules/init-package-json/test/npm-defaults.js deleted file mode 100644 index 292b9623a..000000000 --- a/node_modules/init-package-json/test/npm-defaults.js +++ /dev/null @@ -1,109 +0,0 @@ -var test = require('tap').test -var rimraf = require('rimraf') -var resolve = require('path').resolve - -var npm = require('npm') -var init = require('../') - -var EXPECTED = { - name: 'test', - version: '3.1.4', - description: '', - main: 'basic.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - keywords: [], - author: 'npmbot <n@p.m> (http://npm.im/)', - license: 'WTFPL' -} - -test('npm configuration values pulled from environment', function (t) { - /*eslint camelcase:0 */ - process.env.npm_config_yes = 'yes' - - process.env.npm_config_init_author_name = 'npmbot' - process.env.npm_config_init_author_email = 'n@p.m' - process.env.npm_config_init_author_url = 'http://npm.im' - - process.env.npm_config_init_license = EXPECTED.license - process.env.npm_config_init_version = EXPECTED.version - - npm.load({}, function (err) { - t.ifError(err, 'npm loaded successfully') - - // clear out dotted names from test environment - npm.config.del('init.author.name') - npm.config.del('init.author.email') - npm.config.del('init.author.url') - // the following have npm defaults, and need to be explicitly overridden - npm.config.set('init.license', '') - npm.config.set('init.version', '') - - process.chdir(resolve(__dirname)) - init(__dirname, __dirname, npm.config, function (er, data) { - t.ifError(err, 'init ran successfully') - - t.same(data, EXPECTED, 'got the package data from the environment') - t.end() - }) - }) -}) - -test('npm configuration values pulled from dotted config', function (t) { - /*eslint camelcase:0 */ - var config = { - yes: 'yes', - - 'init.author.name': 'npmbot', - 'init.author.email': 'n@p.m', - 'init.author.url': 'http://npm.im', - - 'init.license': EXPECTED.license, - 'init.version': EXPECTED.version - } - - npm.load(config, function (err) { - t.ifError(err, 'npm loaded successfully') - - process.chdir(resolve(__dirname)) - init(__dirname, __dirname, npm.config, function (er, data) { - t.ifError(err, 'init ran successfully') - - t.same(data, EXPECTED, 'got the package data from the config') - t.end() - }) - }) -}) - -test('npm configuration values pulled from dashed config', function (t) { - /*eslint camelcase:0 */ - var config = { - yes: 'yes', - - 'init-author-name': 'npmbot', - 'init-author-email': 'n@p.m', - 'init-author-url': 'http://npm.im', - - 'init-license': EXPECTED.license, - 'init-version': EXPECTED.version - } - - npm.load(config, function (err) { - t.ifError(err, 'npm loaded successfully') - - process.chdir(resolve(__dirname)) - init(__dirname, __dirname, npm.config, function (er, data) { - t.ifError(err, 'init ran successfully') - - t.same(data, EXPECTED, 'got the package data from the config') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(resolve(__dirname, 'package.json')) - t.pass('cleaned up') - t.end() -}) diff --git a/node_modules/init-package-json/test/scope-in-config-existing-name.js b/node_modules/init-package-json/test/scope-in-config-existing-name.js deleted file mode 100644 index 39dc90f42..000000000 --- a/node_modules/init-package-json/test/scope-in-config-existing-name.js +++ /dev/null @@ -1,30 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var rimraf = require('rimraf') -var tap = require('tap') - -var init = require('../') - -var json = { - name: '@already/scoped', - version: '1.0.0' -} - -tap.test('with existing package.json', function (t) { - fs.writeFileSync(path.join(__dirname, 'package.json'), JSON.stringify(json, null, 2)) - console.log(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8')) - console.error('wrote json', json) - init(__dirname, __dirname, { yes: 'yes', scope: '@still' }, function (er, data) { - if (er) throw er - - console.log('') - t.equal(data.name, '@still/scoped', 'new scope is added, basic name is kept') - t.end() - }) -}) - -tap.test('teardown', function (t) { - rimraf.sync(path.join(__dirname, 'package.json')) - t.end() -}) diff --git a/node_modules/init-package-json/test/scope-in-config.js b/node_modules/init-package-json/test/scope-in-config.js deleted file mode 100644 index 32bba16ed..000000000 --- a/node_modules/init-package-json/test/scope-in-config.js +++ /dev/null @@ -1,33 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var rimraf = require('rimraf') -var tap = require('tap') - -var init = require('../') - -var EXPECT = { - name: '@scoped/test', - version: '1.0.0', - description: '', - author: '', - scripts: { test: 'echo \"Error: no test specified\" && exit 1' }, - main: 'basic.js', - keywords: [], - license: 'ISC' -} - -tap.test('--yes with scope', function (t) { - init(__dirname, __dirname, { yes: 'yes', scope: '@scoped' }, function (er, data) { - if (er) throw er - - console.log('') - t.has(data, EXPECT) - t.end() - }) -}) - -tap.test('teardown', function (t) { - rimraf.sync(path.join(__dirname, 'package.json')) - t.end() -}) diff --git a/node_modules/init-package-json/test/scope.js b/node_modules/init-package-json/test/scope.js deleted file mode 100644 index 4fa064928..000000000 --- a/node_modules/init-package-json/test/scope.js +++ /dev/null @@ -1,39 +0,0 @@ -var tap = require('tap') -var init = require('../') -var rimraf = require('rimraf') - -var EXPECT = { - name: '@foo/test', - version: '1.2.5', - description: 'description', - author: 'npmbot <n@p.m> (http://npm.im)', - scripts: { test: 'make test' }, - main: 'main.js', - config: { scope: '@foo' }, - package: {} -} - -tap.test('the scope', function (t) { - var i = __dirname + '/basic.input' - var dir = __dirname - init(dir, i, {scope: '@foo'}, function (er, data) { - if (er) throw er - - console.log('') - t.has(data, EXPECT) - t.end() - }) - setTimeout(function () { - process.stdin.emit('data', '@foo/test\n') - }, 50) - setTimeout(function () { - process.stdin.emit('data', 'description\n') - }, 100) - setTimeout(function () { - process.stdin.emit('data', 'yes\n') - }, 150) -}) - -tap.test('teardown', function (t) { - rimraf(__dirname + '/package.json', t.end.bind(t)) -}) diff --git a/node_modules/init-package-json/test/silent.js b/node_modules/init-package-json/test/silent.js deleted file mode 100644 index 493702056..000000000 --- a/node_modules/init-package-json/test/silent.js +++ /dev/null @@ -1,23 +0,0 @@ -var tap = require('tap') -var init = require('../') -var rimraf = require('rimraf') - -var log = console.log -var logged = false -console.log = function () { - logged = true -} - -tap.test('silent: true', function (t) { - init(__dirname, __dirname, {yes: 'yes', silent: true}, function (er, data) { - if (er) throw er - - t.false(logged, 'did not print anything') - t.end() - }) -}) - -tap.test('teardown', function (t) { - console.log = log - rimraf(__dirname + '/package.json', t.end.bind(t)) -}) diff --git a/node_modules/init-package-json/test/yes-defaults.js b/node_modules/init-package-json/test/yes-defaults.js deleted file mode 100644 index f7cae28c5..000000000 --- a/node_modules/init-package-json/test/yes-defaults.js +++ /dev/null @@ -1,27 +0,0 @@ -var tap = require('tap') -var init = require('../') -var rimraf = require('rimraf') - -var EXPECT = { - name: 'test', - version: '1.0.0', - description: '', - author: '', - scripts: { test: 'echo "Error: no test specified" && exit 1' }, - main: 'basic.js', - keywords: [], - license: 'ISC' -} - -tap.test('--yes defaults', function (t) { - init(__dirname, __dirname, {yes: 'yes'}, function (er, data) { - if (er) throw er - - t.has(data, EXPECT, 'used the default data') - t.end() - }) -}) - -tap.test('teardown', function (t) { - rimraf(__dirname + '/package.json', t.end.bind(t)) -}) |