UNPKG

@naoufal/create-react-component

Version:
82 lines (64 loc) 2.45 kB
const { pathQuestion, nameQuestion, templateQuestion, typeQuestion } = require('./questions'); describe('Questions', () => { describe('pathQuestion', () => { test('should use `path` as a variable name', () => { expect(pathQuestion.name).toBe('path'); }); test('should be a text input', () => { expect(pathQuestion.type).toBe('input'); }); test('should display the following input message: `Where would you like to create this component?`', () => { expect(pathQuestion.message).toBe('Where would you like to create this component?') }); test('should have a validate function', () => { expect(pathQuestion.validate).toBeDefined(); }); }); describe('nameQuestion', () => { test('should use `name` as a variable name', () => { expect(nameQuestion.name).toBe('name'); }); test('should be a text input', () => { expect(nameQuestion.type).toBe('input'); }); test('should display the following input message: `What would you like to name your component?`', () => { expect(nameQuestion.message).toBe('What would you like to name your component?') }); test('should have a validate function', () => { expect(nameQuestion.validate).toBeDefined(); }); }); describe('templateQuestion', () => { test('should use `template` as a variable name', () => { expect(templateQuestion.name).toBe('template'); }); test('should be a list input', () => { expect(templateQuestion.type).toBe('list'); }); test('should display the following input message: `What component template would you like to use?`', () => { expect(templateQuestion.message).toBe('What component template would you like to use?') }); test('should have a choices function', () => { expect(templateQuestion.choices).toBeDefined(); }); }); describe('typeQuestion', () => { test('should use `type` as a variable name', () => { expect(typeQuestion.name).toBe('type'); }); test('should be a list input', () => { expect(typeQuestion.type).toBe('list'); }); test('should display the following input message: `What type of component would like to use?`', () => { expect(typeQuestion.message).toBe('What type of component would like to use?') }); test('should have a choices function', () => { expect(typeQuestion.choices).toBeDefined(); }); }); });