1 |
|
2 |
|
3 |
|
4 |
|
5 | 'use strict'
|
6 |
|
7 | const askconfig = require('../lib/askconfig.js')
|
8 | const childProcess = require('child_process')
|
9 | const assert = require('assert')
|
10 | const injectmock = require('injectmock')
|
11 |
|
12 | describe('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 |
|
32 | spawn.kill()
|
33 | spawn.on('exit', () => {
|
34 | done()
|
35 | })
|
36 | })
|
37 | })
|
38 |
|