chore: identify api mongo connections

This commit is contained in:
dahyeon committed 2026-06-26 09:56:58 -07:00
1 parent 51ea9c42d3
commit 4ab5722759
2 files changed
+25 -2

No files matched your search

@@ -1,4 +1,4 @@
import { resolveMongoDbName } from './connection.service';
import { resolveMongoAppName, resolveMongoDbName } from './connection.service';
describe('resolveMongoDbName', () => {
it('uses production database only for prod', () => {
@@ -12,3 +12,15 @@ describe('resolveMongoDbName', () => {
expect(resolveMongoDbName('local')).toBe('lolympus-dev');
});
});
describe('resolveMongoAppName', () => {
it('identifies api environment and process for MongoDB connection tracking', () => {
expect(resolveMongoAppName('staging', 1234)).toBe(
'lolympus-api:staging:1234',
);
});
it('uses dev as the fallback environment label', () => {
expect(resolveMongoAppName('', 1234)).toBe('lolympus-api:dev:1234');
});
});