Skip to content

Commit

Permalink
tests(inputvalidate): remove undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
misterdev committed May 29, 2019
1 parent 376dcbd commit fb25bd2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Expand Up @@ -2,7 +2,6 @@

exports[`utils Inquirer should make an Input object with validation 1`] = `
Object {
"default": undefined,
"message": "what is your plugin?",
"name": "plugins",
"type": "input",
Expand Down
1 change: 0 additions & 1 deletion packages/webpack-scaffold/__tests__/index.test.ts
Expand Up @@ -76,7 +76,6 @@ describe("utils", () => {
});
it("should make an Input object", () => {
expect(utils.Input("plugins", "what is your plugin?")).toEqual({
default: undefined,
message: "what is your plugin?",
name: "plugins",
type: "input",
Expand Down
5 changes: 3 additions & 2 deletions packages/webpack-scaffold/index.ts
Expand Up @@ -92,13 +92,14 @@ export function InputValidate(
defaultChoice?: string,
): Generator.Question {

return {
default: defaultChoice,
const input: Generator.Question = {
message,
name,
type: "input",
validate: cb
};
if (defaultChoice !== undefined) input.default = defaultChoice;
return input;
}

export function Confirm(name: string, message: string, defaultChoice: boolean = true): Generator.Question {
Expand Down

0 comments on commit fb25bd2

Please sign in to comment.