Skip to content

Commit

Permalink
[create-sitecore-jss] Better wording around multiple apps installed (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
art-alexeyenko authored Aug 14, 2024
1 parent a422356 commit 0777253
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
18 changes: 16 additions & 2 deletions packages/create-sitecore-jss/src/common/processes/next.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,22 @@ describe('next', () => {
expect(
calls.some(
(call) =>
call.args[0] ===
`JSS application(s) ${chalk.green('my-cool-app, second-app')} are ready!`
call.args[0] === `JSS applications ${chalk.green('my-cool-app, second-app')} are ready!`
)
).to.equal(true);
});

it('displays single app name with single item wording in output', async () => {
const appNames = ['my-cool-app'];
await nextSteps(appNames, []);

const calls = log.getCalls();
calls.forEach((call) => {
console.log(call.args[0]);
});
expect(
calls.some(
(call) => call.args[0] === `JSS application ${chalk.green('my-cool-app')} is ready!`
)
).to.equal(true);
});
Expand Down
10 changes: 5 additions & 5 deletions packages/create-sitecore-jss/src/common/processes/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import chalk from 'chalk';
* @param {string[]} nextStepsArr next steps to be performed after app is created
*/
export const nextSteps = async (appNames: string[], nextStepsArr: string[]) => {
const successMessage =
appNames.length > 1
? `JSS applications ${chalk.green(appNames.join(', '))} are ready!`
: `JSS application ${chalk.green(appNames[0])} is ready!`;
console.log(chalk.red(' -/oyhdmNNNNmdhyo/- '));
console.log(chalk.red(' :sdMMMMMMMMMMMMMMMMMMMMds: '));
console.log(chalk.red(' :yNMMMMMMMMMMMMMMMMMMMMMMMMMMNy: '));
Expand Down Expand Up @@ -37,11 +41,7 @@ export const nextSteps = async (appNames: string[], nextStepsArr: string[]) => {
console.log(chalk.white(' / // /\\ \\_\\ \\ '));
console.log(chalk.white(' \\___/___/___/'));
console.log();
console.log(
`JSS application(s) ${chalk.green(appNames.join(', '))} ${
appNames.length > 1 ? 'are' : 'is'
} ready!`
);
console.log(successMessage);
console.log();
console.log(chalk.yellow('Next steps:'));
nextStepsArr.forEach((step) => {
Expand Down

0 comments on commit 0777253

Please sign in to comment.