mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
901 B
39 lines
901 B
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))
|
|
})
|
|
|