-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vcs-host): provided the terminal-prompt to the vcs-host scaffolder
- Loading branch information
Showing
4 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {prompt} from '@form8ion/overridable-prompts'; | ||
|
||
export default function ({questions, decisions}) { | ||
return prompt(questions, decisions); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {prompt as promptWithInquirer} from '@form8ion/overridable-prompts'; | ||
|
||
import {when} from 'jest-when'; | ||
import {describe, it, vi, expect} from 'vitest'; | ||
import any from '@travi/any'; | ||
|
||
import prompt from './terminal-prompt.js'; | ||
|
||
vi.mock('@form8ion/overridable-prompts'); | ||
|
||
describe('terminal prompt', () => { | ||
it('should present the provided questions using inquirer', async () => { | ||
const questions = any.listOf(any.simpleObject); | ||
const decisions = any.simpleObject(); | ||
const answers = any.simpleObject(); | ||
when(promptWithInquirer).calledWith(questions, decisions).mockResolvedValue(answers); | ||
|
||
expect(await prompt({questions, decisions})).toEqual(answers); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters