summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/init-package-json/test
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2015-03-06 02:57:32 -0600
committercjihrig <cjihrig@gmail.com>2015-03-06 11:20:05 -0500
commitfe14802fb700c5fea08b7c54f4298c3ac44a5c15 (patch)
tree74b43bf61e98f366089a416e4fe36b2f1256cd5d /deps/npm/node_modules/init-package-json/test
parentc09c90c1a9e74ee4f29a051daf10bc4c5d5f7755 (diff)
downloadnode-new-fe14802fb700c5fea08b7c54f4298c3ac44a5c15.tar.gz
deps: upgrade npm to 2.7.0
PR-URL: https://github.com/iojs/io.js/pull/1080 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/init-package-json/test')
-rw-r--r--deps/npm/node_modules/init-package-json/test/npm-defaults.js2
-rw-r--r--deps/npm/node_modules/init-package-json/test/scope.js35
2 files changed, 36 insertions, 1 deletions
diff --git a/deps/npm/node_modules/init-package-json/test/npm-defaults.js b/deps/npm/node_modules/init-package-json/test/npm-defaults.js
index 666e9a1c49..f65f646316 100644
--- a/deps/npm/node_modules/init-package-json/test/npm-defaults.js
+++ b/deps/npm/node_modules/init-package-json/test/npm-defaults.js
@@ -14,7 +14,7 @@ var EXPECTED = {
test : 'echo "Error: no test specified" && exit 1'
},
keywords : [],
- author : "npmbot <n@p.m> (http://npm.im/)",
+ author : "npmbot <n@p.m> (http://npm.im)",
license : "WTFPL"
}
diff --git a/deps/npm/node_modules/init-package-json/test/scope.js b/deps/npm/node_modules/init-package-json/test/scope.js
new file mode 100644
index 0000000000..7049a4db40
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/test/scope.js
@@ -0,0 +1,35 @@
+var tap = require('tap')
+var init = require('../')
+var rimraf = require('rimraf')
+
+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
+ var expect =
+ { name: '@foo/test',
+ version: '1.2.5',
+ description: 'description',
+ author: 'me <em@i.l> (http://url)',
+ scripts: { test: 'make test' },
+ main: 'main.js',
+ config: { scope: 'foo' },
+ package: {} }
+ t.same(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))
+})