0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Simplifying upgrade message format

- Remove 'to' particle from update messages
- Adjusted spacing in version comparison output
- Update tests to match the spacing

Before:
▲  astro can be updated to v1.0.0 → v2.0.0

After:
▲  astro can be updated  v1.0.0 → v2.0.0
This commit is contained in:
idkgene 2024-12-15 13:52:25 +03:00
parent 2e71a3ec61
commit da9b3b2b50
2 changed files with 6 additions and 6 deletions

View file

@ -48,7 +48,7 @@ export async function install(
const majors: PackageInfo[] = [];
for (const packageInfo of toInstall) {
const word = ctx.dryRun ? 'can' : 'will';
await upgrade(packageInfo, `${word} be updated to`);
await upgrade(packageInfo, `${word} be updated`);
if (packageInfo.isMajor) {
majors.push(packageInfo);
}

View file

@ -81,7 +81,7 @@ describe('install', () => {
],
};
await install(context);
assert.equal(fixture.hasMessage('▲ astro can be updated v1.0.0 → v2.0.0'), true);
assert.equal(fixture.hasMessage('▲ astro can be updated v1.0.0 → v2.0.0'), true);
assert.equal(prompted, true);
assert.equal(exitCode, 0);
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), false);
@ -111,7 +111,7 @@ describe('install', () => {
],
};
await install(context);
assert.equal(fixture.hasMessage('▲ astro can be updated v1.0.0 → v2.0.0'), true);
assert.equal(fixture.hasMessage('▲ astro can be updated v1.0.0 → v2.0.0'), true);
assert.equal(prompted, true);
assert.equal(exitCode, undefined);
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), true);
@ -149,8 +149,8 @@ describe('install', () => {
],
};
await install(context);
assert.equal(fixture.hasMessage('▲ a can be updated v1.0.0 → v2.0.0'), true);
assert.equal(fixture.hasMessage('▲ b can be updated v6.0.0 → v7.0.0'), true);
assert.equal(fixture.hasMessage('▲ a can be updated v1.0.0 → v2.0.0'), true);
assert.equal(fixture.hasMessage('▲ b can be updated v6.0.0 → v7.0.0'), true);
assert.equal(prompted, true);
assert.equal(exitCode, undefined);
const [changelog, a, b] = fixture.messages().slice(-5);
@ -201,7 +201,7 @@ describe('install', () => {
assert.equal(fixture.hasMessage('◼ current is up to date on v1.0.0'), true);
assert.equal(fixture.hasMessage('● patch can be updated v1.0.0 → v1.0.1'), true);
assert.equal(fixture.hasMessage('● minor can be updated v1.0.0 → v1.2.0'), true);
assert.equal(fixture.hasMessage('▲ major can be updated v1.0.0 → v3.0.0'), true);
assert.equal(fixture.hasMessage('▲ major can be updated v1.0.0 → v3.0.0'), true);
assert.equal(prompted, true);
assert.equal(exitCode, undefined);
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), true);