mirror of
https://github.com/withastro/astro.git
synced 2025-03-10 23:01:26 -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:
parent
2e71a3ec61
commit
da9b3b2b50
2 changed files with 6 additions and 6 deletions
|
@ -48,7 +48,7 @@ export async function install(
|
||||||
const majors: PackageInfo[] = [];
|
const majors: PackageInfo[] = [];
|
||||||
for (const packageInfo of toInstall) {
|
for (const packageInfo of toInstall) {
|
||||||
const word = ctx.dryRun ? 'can' : 'will';
|
const word = ctx.dryRun ? 'can' : 'will';
|
||||||
await upgrade(packageInfo, `${word} be updated to`);
|
await upgrade(packageInfo, `${word} be updated`);
|
||||||
if (packageInfo.isMajor) {
|
if (packageInfo.isMajor) {
|
||||||
majors.push(packageInfo);
|
majors.push(packageInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ describe('install', () => {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
await install(context);
|
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(prompted, true);
|
||||||
assert.equal(exitCode, 0);
|
assert.equal(exitCode, 0);
|
||||||
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), false);
|
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), false);
|
||||||
|
@ -111,7 +111,7 @@ describe('install', () => {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
await install(context);
|
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(prompted, true);
|
||||||
assert.equal(exitCode, undefined);
|
assert.equal(exitCode, undefined);
|
||||||
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), true);
|
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), true);
|
||||||
|
@ -149,8 +149,8 @@ describe('install', () => {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
await install(context);
|
await install(context);
|
||||||
assert.equal(fixture.hasMessage('▲ a can be updated v1.0.0 → v2.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(fixture.hasMessage('▲ b can be updated v6.0.0 → v7.0.0'), true);
|
||||||
assert.equal(prompted, true);
|
assert.equal(prompted, true);
|
||||||
assert.equal(exitCode, undefined);
|
assert.equal(exitCode, undefined);
|
||||||
const [changelog, a, b] = fixture.messages().slice(-5);
|
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('◼ 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('● 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('● 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(prompted, true);
|
||||||
assert.equal(exitCode, undefined);
|
assert.equal(exitCode, undefined);
|
||||||
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), true);
|
assert.equal(fixture.hasMessage('check Be sure to follow the CHANGELOG.'), true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue