Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions packages/cli-repl/src/cli-repl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2773,19 +2773,19 @@ describe('CliRepl', function () {
(process as any).version = actualVersions.node;
});

it('prints a deprecation warning when running on platforms with GLIBC < 2.28, otherwise not', async function () {
for (const { version, deprecated } of [
{ version: '3.0+glibcstring', deprecated: false },
{ version: '2.28.2', deprecated: false },
{ version: '2.28', deprecated: false },
// This might look like is deprecated but since this is not a valid
// semver even after co-ercion, we don't push warnings for such versions
{ version: '1.08', deprecated: false },
{ version: '2.21', deprecated: true },
{ version: '2.21-glibcstring', deprecated: true },
{ version: '2.21.4', deprecated: true },
{ version: '1.3.8', deprecated: true },
]) {
for (const { version, deprecated } of [
{ version: '3.0+glibcstring', deprecated: false },
{ version: '2.28.2', deprecated: false },
{ version: '2.28', deprecated: false },
// This might look like is deprecated but since this is not a valid
// semver even after co-ercion, we don't push warnings for such versions
{ version: '1.08', deprecated: false },
{ version: '2.21', deprecated: true },
{ version: '2.21-glibcstring', deprecated: true },
{ version: '2.21.4', deprecated: true },
{ version: '1.3.8', deprecated: true },
]) {
it(`prints a deprecation warning when running on platforms with GLIBC < 2.28, otherwise not (version=${version})`, async function () {
cliRepl = new CliRepl(cliReplOptions);
cliRepl.getGlibcVersion = () => version;
await cliRepl.start('', {});
Expand All @@ -2803,8 +2803,8 @@ describe('CliRepl', function () {
'Using mongosh on the current operating system is deprecated, and support may be removed in a future release.'
);
}
}
});
});
}

it('does not print a platform unsupported deprecation warning when GLIBC information is not present (non-linux systems)', async function () {
cliRepl = new CliRepl(cliReplOptions);
Expand All @@ -2816,17 +2816,17 @@ describe('CliRepl', function () {
);
});

it('prints a deprecation warning when running with OpenSSL < 3.0.0, otherwise not', async function () {
for (const { version, deprecated } of [
{ version: '4.0.1+uniqssl', deprecated: false },
{ version: '4.0', deprecated: false },
{ version: '3.0+uniqssl', deprecated: false },
{ version: '3.0', deprecated: false },
{ version: '2.21', deprecated: true },
{ version: '2.21-uniqssl', deprecated: true },
{ version: '2.21.4', deprecated: true },
{ version: '1.3.8', deprecated: true },
]) {
for (const { version, deprecated } of [
{ version: '4.0.1+uniqssl', deprecated: false },
{ version: '4.0', deprecated: false },
{ version: '3.0+uniqssl', deprecated: false },
{ version: '3.0', deprecated: false },
{ version: '2.21', deprecated: true },
{ version: '2.21-uniqssl', deprecated: true },
{ version: '2.21.4', deprecated: true },
{ version: '1.3.8', deprecated: true },
]) {
it(`prints a deprecation warning when running with OpenSSL < 3.0.0, otherwise not (version=${version})`, async function () {
delete (process.versions as any).openssl;
(process.versions as any).openssl = version;

Expand All @@ -2845,8 +2845,8 @@ describe('CliRepl', function () {
'Using mongosh with OpenSSL versions lower than 3.0.0 is deprecated, and support may be removed in a future release.'
);
}
}
});
});
}

it('prints a deprecation warning when running on Node.js < 20.0.0', async function () {
for (const { version, deprecated } of [
Expand Down