diff --git a/types/prompts/prompts-tests.ts b/types/prompts/prompts-tests.ts index 0b89cb3721..bd35868c66 100644 --- a/types/prompts/prompts-tests.ts +++ b/types/prompts/prompts-tests.ts @@ -1,8 +1,14 @@ import prompts = require("prompts"); -const response = prompts({ - type: 'number', - name: 'value', - message: 'Input value to double:', - validate: (value: any) => value < 0 ? `Cant be less than zero` : true -}); +type HasProperty = K extends keyof T ? true : false; + +(async () => { + const response = await prompts({ + type: "number", + name: "value", + message: "Input value to double:", + validate: (value: any) => (value < 0 ? `Cant be less than zero` : true) + }); + const HasPropValue: HasProperty = true; + const DoesntHavePropAsdf: HasProperty = false; +})();