1
0
mirror of synced 2025-11-08 12:57:47 +00:00

test(CLI): cover all the things

This commit is contained in:
Jason Dreyzehner
2018-03-10 16:37:42 -05:00
parent 18e71a16aa
commit 1e2c5930f0
2 changed files with 55 additions and 7 deletions

View File

@@ -144,11 +144,22 @@ export async function typescriptStarter(
await tasks.install(install, runner, projectPath);
const spinner7 = ora(`Initializing git repository`).start();
(await tasks.initialCommit(commitHash, projectPath, gitName, gitEmail))
? spinner7.succeed()
: spinner7.fail(
"Git config user.name and user.email are not configured. You'll need to `git commit` yourself."
);
completeSpinner(
spinner7,
await tasks.initialCommit(commitHash, projectPath, gitName, gitEmail),
"Git config user.name and user.email are not configured. You'll need to `git commit` yourself."
);
console.log(`\n${chalk.blue.bold(`Created ${name} 🎉`)}\n`);
}
export function completeSpinner(
spinner: {
readonly succeed: (text?: string) => any;
readonly fail: (text?: string) => any;
},
success: boolean,
message?: string
): void {
success ? spinner.succeed() : spinner.fail(message);
}