-
Notifications
You must be signed in to change notification settings - Fork 8
/
debug-single.js
executable file
路52 lines (42 loc) 路 1.37 KB
/
debug-single.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
'use strict';
//polyfills
const process = require('suman-browser-polyfills/modules/process');
const global = require('suman-browser-polyfills/modules/global');
//core
const assert = require('assert');
const util = require('util');
const path = require('path');
const fs = require('fs');
const cp = require('child_process');
//npm
const colors = require('colors/safe');
const inquirer = require('suman-inquirer');
//project
const _suman = global.__suman = (global.__suman || {});
const rejectionHandler = require('../interactive-rejection-handler');
const choices = require('./choices');
//////////////////////////////////////////////////////////////
module.exports = function debugSingle (opts, backspaceCB) {
const exec = opts.exec;
return inquirer.prompt([
{
type: 'list',
name: 'debugCmd',
message: 'Which technique would you like to use to debug your tests?',
onLeftKey: function () {
_suman.onBackspace(backspaceCB);
},
when: function () {
console.log('\n\n ----------------------------------------------- \n\n');
return true;
},
choices: exec === 'node' ? choices.nodeDebug : choices.sumanDebug,
filter: function (val) {
return val;
}
},
]).then(function (answers) {
_interactiveDebug('answers in debug-single =>', answers);
return Object.assign(opts, answers);
});
};