insomnia/packages/insomnia-inso/__mocks__/enquirer.js
Opender Singh 27f006bc46
Prompt for test suite from CLI (#2338)
* Add unit tests to git-repo fixture

* Add to nedb fixture

* Can read suites and tests from git repo and nedb

* Prompt for test suite

* Prompt for env

* sub envs

* Add noenv to env prompt

* Add --ci flag to disable prompts

* Hook up --keep-file

* WIP

* WIP

* WIP

* Update

* Fix unit tests

* Update webpack config

* Fix

* fix

* Package lock

* Disable console.log when running unit tests

* no-log wrap

* Console log test

* Console log test

* Tests

* Add tests for cli

* Update

* WIP

* More tests

* fix

* Prompt test suite tests

* env prompt tests

* Update

* Update

* Extract workspace model

* Extract apiSpec model

* Extract unitTestSuite model

* Extract environment model

* Move types and prompts

* Rename
2020-07-08 08:17:02 +12:00

21 lines
301 B
JavaScript

const __constructorMock = jest.fn();
let returnValue = 'test';
class Prompt {
constructor(options) {
__constructorMock(options);
}
run() {
return returnValue;
}
}
module.exports = {
__constructorMock,
__mockPromptRun: v => {
returnValue = v;
},
AutoComplete: Prompt,
};