Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(generators): send warning regarding invalid template to stderr #2687

Merged
merged 2 commits into from May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/generators/src/init-generator.ts
Expand Up @@ -58,7 +58,7 @@ export default class InitGenerator extends CustomGenerator {
}

if (!this.supportedTemplates.includes(this.template)) {
this.utils.logger.log(`${yellow(`⚠ ${this.template} is not a valid template, please select one from below`)}`);
this.utils.logger.warn(`⚠ ${this.template} is not a valid template, please select one from below`);

const { selectedTemplate } = await Question.List(
this,
Expand Down
2 changes: 1 addition & 1 deletion test/init/init.test.js
Expand Up @@ -112,7 +112,7 @@ describe('init command', () => {
const { stdout, stderr } = await runPromptWithAnswers(assetsPath, ['init', '--force', '--template=apple'], [`${ENTER}`]);

expect(stdout).toContain('Project has been initialised with webpack!');
expect(stdout).toContain('apple is not a valid template, please select one from below');
expect(stderr).toContain('apple is not a valid template, please select one from below');
expect(stderr).toContain('webpack.config.js');

// Test files
Expand Down