Skip to content

Commit d56da5b

Browse files
committed
migrate
1 parent 36609b1 commit d56da5b

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

test/integration/sessions/sessions.prose.test.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1+
import { ObjectId } from 'bson';
12
import { expect } from 'chai';
23
import { type ChildProcess, spawn } from 'child_process';
34
import { once } from 'events';
45
import * as os from 'os';
56
import * as path from 'path';
67

7-
import {
8-
type Collection,
9-
type CommandStartedEvent,
10-
MongoClient,
11-
MongoDriverError,
12-
MongoInvalidArgumentError,
13-
ObjectId
14-
} from '../../mongodb';
8+
import { type CommandStartedEvent } from '../../../src/cmap/command_monitoring_events';
9+
import { type Collection } from '../../../src/collection';
10+
import { MongoDriverError, MongoInvalidArgumentError } from '../../../src/error';
11+
import { MongoClient } from '../../../src/mongo_client';
1512
import { sleep } from '../../tools/utils';
1613

1714
describe('Sessions Prose Tests', () => {

test/integration/sessions/sessions.test.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { MongoClient as LegacyMongoClient } from 'mongodb-legacy';
33

44
import {
55
type CommandStartedEvent,
6-
type CommandSucceededEvent,
7-
LEGACY_HELLO_COMMAND,
8-
type MongoClient,
9-
MongoServerError
10-
} from '../../mongodb';
6+
type CommandSucceededEvent
7+
} from '../../../src/cmap/command_monitoring_events';
8+
import { LEGACY_HELLO_COMMAND } from '../../../src/constants';
9+
import { MongoServerError } from '../../../src/error';
10+
import { type MongoClient } from '../../../src/mongo_client';
1111
import type { TestConfiguration } from '../../tools/runner/config';
1212
import { setupDatabase } from '../shared';
1313

@@ -70,19 +70,16 @@ describe('Sessions Spec', function () {
7070
await test.setup(this.configuration);
7171
});
7272

73-
it('should send endSessions for multiple sessions', function (done) {
73+
it('should send endSessions for multiple sessions', async function () {
7474
const client = test.client;
7575
const sessions = [client.startSession(), client.startSession()].map(s => s.id);
7676

77-
client.close(err => {
78-
expect(err).to.not.exist;
79-
expect(test.commands.started).to.have.length(1);
80-
expect(test.commands.started[0].commandName).to.equal('endSessions');
81-
expect(test.commands.started[0].command.endSessions).to.include.deep.members(sessions);
82-
expect(client.s.activeSessions.size).to.equal(0);
77+
await client.close();
8378

84-
done();
85-
});
79+
expect(test.commands.started).to.have.length(1);
80+
expect(test.commands.started[0].commandName).to.equal('endSessions');
81+
expect(test.commands.started[0].command.endSessions).to.include.deep.members(sessions);
82+
expect(client.s.activeSessions.size).to.equal(0);
8683
});
8784
});
8885

0 commit comments

Comments
 (0)