Skip to content

Commit

Permalink
chore: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Dec 19, 2024
1 parent 25937e0 commit eb7c0a5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/backend/server/tests/version.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ test('should be able to prevent requests if version outdated', async t => {
await runtime.set('version/allowedVersion', 'unknownVersion');
await t.notThrowsAsync(
fetchWithVersion(app.getHttpServer(), undefined, HttpStatus.OK),
'should not check version if invalid minVersion provided'
'should not check version if invalid allowedVersion provided'
);
await t.notThrowsAsync(
fetchWithVersion(app.getHttpServer(), '0.0.1', HttpStatus.OK),
'should not check version if invalid minVersion provided'
'should not check version if invalid allowedVersion provided'
);

await runtime.set('version/allowedVersion', '0.0.1');
Expand All @@ -121,7 +121,7 @@ test('should be able to prevent requests if version outdated', async t => {
{
message: 'Unsupported client version: 0.0.0, please upgrade to 0.0.1.',
},
'should reject version if valid minVersion provided'
'should reject version if valid allowedVersion provided'
);

await runtime.set(
Expand All @@ -130,15 +130,15 @@ test('should be able to prevent requests if version outdated', async t => {
);
await t.notThrowsAsync(
fetchWithVersion(app.getHttpServer(), '0.17.5', HttpStatus.OK),
'should pass version if version satisfies minVersion'
'should pass version if version satisfies allowedVersion'
);
await t.throwsAsync(
fetchWithVersion(app.getHttpServer(), '0.17.4', HttpStatus.FORBIDDEN),
{
message:
'Unsupported client version: 0.17.4, please upgrade to 0.18.0.',
},
'should reject version if valid minVersion provided'
'should reject version if valid allowedVersion provided'
);
await t.throwsAsync(
fetchWithVersion(
Expand All @@ -150,19 +150,19 @@ test('should be able to prevent requests if version outdated', async t => {
message:
'Unsupported client version: 0.17.6-nightly-f0d99f4, please upgrade to 0.18.0.',
},
'should reject version if valid minVersion provided'
'should reject version if valid allowedVersion provided'
);
await t.notThrowsAsync(
fetchWithVersion(
app.getHttpServer(),
'0.18.0-nightly-cc9b38c',
HttpStatus.OK
),
'should pass version if version satisfies minVersion'
'should pass version if version satisfies allowedVersion'
);
await t.notThrowsAsync(
fetchWithVersion(app.getHttpServer(), '0.18.1', HttpStatus.OK),
'should pass version if version satisfies minVersion'
'should pass version if version satisfies allowedVersion'
);
}

Expand All @@ -174,18 +174,18 @@ test('should be able to prevent requests if version outdated', async t => {

await t.notThrowsAsync(
fetchWithVersion(app.getHttpServer(), '0.0.1', HttpStatus.OK),
'should pass version if version satisfies minVersion'
'should pass version if version satisfies allowedVersion'
);
await t.notThrowsAsync(
fetchWithVersion(app.getHttpServer(), '0.1.2', HttpStatus.OK),
'should pass version if version satisfies maxVersion'
'should pass version if version satisfies allowedVersion'
);
await t.throwsAsync(
fetchWithVersion(app.getHttpServer(), '0.1.3', HttpStatus.FORBIDDEN),
{
message: 'Unsupported client version: 0.1.3, please upgrade to 0.3.0.',
},
'should reject version if valid maxVersion provided'
'should reject version if valid allowedVersion provided'
);

await t.notThrowsAsync(
Expand All @@ -194,15 +194,15 @@ test('should be able to prevent requests if version outdated', async t => {
'0.2.0-nightly-cc9b38c',
HttpStatus.OK
),
'should pass version if version satisfies maxVersion'
'should pass version if version satisfies allowedVersion'
);

await t.throwsAsync(
fetchWithVersion(app.getHttpServer(), '0.2.0', HttpStatus.FORBIDDEN),
{
message: 'Unsupported client version: 0.2.0, please upgrade to 0.3.0.',
},
'should reject version if valid maxVersion provided'
'should reject version if valid allowedVersion provided'
);

await t.throwsAsync(
Expand All @@ -211,7 +211,7 @@ test('should be able to prevent requests if version outdated', async t => {
message:
'Unsupported client version: 0.3.1, please downgrade to 0.3.0.',
},
'should reject version if valid maxVersion provided'
'should reject version if valid allowedVersion provided'
);
}
});

0 comments on commit eb7c0a5

Please sign in to comment.