UNPKG

728 BJavaScriptView Raw
1/**
2 * Test case for askconfig.
3 * Runs with mocha.
4 */
5'use strict'
6
7const askconfig = require('../lib/askconfig.js')
8const childProcess = require('child_process')
9const assert = require('assert')
10const injectmock = require('injectmock')
11
12describe('askconfig', () => {
13 before((done) => {
14 done()
15 })
16
17 after((done) => {
18 injectmock.restoreAll()
19 done()
20 })
21
22 it('Askconfig', (done) => {
23 let shell = require.resolve('../doc/mocks/mock_some_shell.js')
24 let spawn = childProcess.spawn(shell, {
25 stdio: [
26 process.stdin,
27 process.stdout,
28 process.stderr
29 ]
30 })
31 //process.stdin.write('bar\n\n\n')
32 spawn.kill()
33 spawn.on('exit', () => {
34 done()
35 })
36 })
37})
38