Skip to content

Commit e997782

Browse files
committed
fixup: broader uuid connectionStatus filter
1 parent bae5c14 commit e997782

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/integration.spec.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ async function fetchBrowser({ url }: OpenBrowserOptions): Promise<void> {
3030
(await fetch(url)).body?.resume();
3131
}
3232

33+
function filterConnectionStatus(
34+
status: Record<string, unknown>
35+
): Record<string, unknown> {
36+
// 8.1.0-rc0+ (SERVER-91936) adds and UUID to the response
37+
const { ok, authInfo } = { ...status };
38+
return { ok, authInfo };
39+
}
40+
3341
describe('integration test with mongod', function () {
3442
this.timeout(90_000);
3543

@@ -109,7 +117,7 @@ describe('integration test with mongod', function () {
109117
const status = await client
110118
.db('admin')
111119
.command({ connectionStatus: 1 });
112-
expect(status).to.deep.equal({
120+
expect(filterConnectionStatus(status)).to.deep.equal({
113121
ok: 1,
114122
authInfo: {
115123
authenticatedUsers: [{ user: 'dev/testuser', db: '$external' }],
@@ -184,7 +192,7 @@ describe('integration test with mongod', function () {
184192
const status = await client
185193
.db('admin')
186194
.command({ connectionStatus: 1 });
187-
expect(status).to.deep.equal({
195+
expect(filterConnectionStatus(status)).to.deep.equal({
188196
ok: 1,
189197
authInfo: {
190198
authenticatedUsers: [{ user: 'dev/testuser', db: '$external' }],
@@ -210,7 +218,7 @@ describe('integration test with mongod', function () {
210218
const status = await client
211219
.db('admin')
212220
.command({ connectionStatus: 1 });
213-
expect(status).to.deep.equal({
221+
expect(filterConnectionStatus(status)).to.deep.equal({
214222
ok: 1,
215223
authInfo: {
216224
authenticatedUsers: [{ user: 'dev/testuser', db: '$external' }],
@@ -234,8 +242,7 @@ describe('integration test with mongod', function () {
234242
const status = await client
235243
.db('admin')
236244
.command({ connectionStatus: 1 });
237-
delete status.uuid; // 8.1.0-rc0+ (SERVER-91936) adds and UUID to the response
238-
expect(status).to.deep.equal({
245+
expect(filterConnectionStatus(status)).to.deep.equal({
239246
ok: 1,
240247
authInfo: {
241248
authenticatedUsers: [{ user: 'dev/testuser', db: '$external' }],
@@ -271,7 +278,7 @@ describe('integration test with mongod', function () {
271278
const status = await client
272279
.db('admin')
273280
.command({ connectionStatus: 1 });
274-
expect(status).to.deep.equal({
281+
expect(filterConnectionStatus(status)).to.deep.equal({
275282
ok: 1,
276283
authInfo: {
277284
authenticatedUsers: [{ user: 'dev/testuser', db: '$external' }],

0 commit comments

Comments
 (0)