diff --git a/test/name-spaces.js b/test/name-spaces.js index a395afb..ba43840 100644 --- a/test/name-spaces.js +++ b/test/name-spaces.js @@ -1,14 +1,15 @@ -var test = require('tap').test -var init = require('../') -var rimraf = require('rimraf') -var common = require('./lib/common') +const { resolve } = require('path') +const t = require('tap') +const init = require('../') +const common = require('./lib/common') -test('spaces', function (t) { - rimraf.sync(__dirname + '/package.json') - init(__dirname, '', {}, function (er, data) { +t.skip('single space', t => { + const dir = t.testdir({}) + + init(dir, '', {}, (er, data) => { if (er) throw er - var wanted = { + const wanted = { name: 'the-name', version: '1.0.0', description: '', @@ -21,9 +22,9 @@ test('spaces', function (t) { t.has(data, wanted) t.end() }) + common.drive([ 'the name\n', - 'the-name\n', '\n', '\n', '\n', @@ -36,6 +37,36 @@ test('spaces', function (t) { ]) }) -test('teardown', function (t) { - rimraf(__dirname + '/package.json', t.end.bind(t)) +t.skip('multiple spaces', t => { + const dir = t.testdir({}) + + init(dir, '', {}, (er, data) => { + if (er) + throw er + const wanted = { + name: 'the-name-should-be-this', + 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 should be this\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + 'yes\n' + ]) })