diff --git a/test/integration/crud/promise_stats.test.js b/test/integration/crud/promise_stats.test.js deleted file mode 100644 index c41352a0253..00000000000 --- a/test/integration/crud/promise_stats.test.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const { assert: test, setupDatabase } = require('../shared'); -const f = require('util').format; - -describe('stats', function () { - before(function () { - return setupDatabase(this.configuration); - }); - - it('Should correctly execute stats using Promise', { - metadata: { - requires: { - topology: ['single'] - } - }, - - test: function (done) { - var configuration = this.configuration; - var url = configuration.url(); - url = - url.indexOf('?') !== -1 - ? f('%s&%s', url, 'maxPoolSize=5') - : f('%s?%s', url, 'maxPoolSize=5'); - - const client = configuration.newClient(url); - client.connect().then(function (client) { - client - .db(configuration.db) - .stats() - .then(function (stats) { - test.ok(stats != null); - - client.close(done); - }); - }); - } - }); -}); diff --git a/test/integration/crud/stats.test.ts b/test/integration/crud/stats.test.ts new file mode 100644 index 00000000000..0a521c00e81 --- /dev/null +++ b/test/integration/crud/stats.test.ts @@ -0,0 +1,21 @@ +import { expect } from 'chai'; + +import { type MongoClient } from '../../../src'; + +describe('stats', function () { + let client: MongoClient; + + beforeEach(async function () { + client = this.configuration.newClient(); + await client.connect(); + }); + + afterEach(async function () { + await client.close(); + }); + + it('correctly executes stats()', async function () { + const stats = await client.db('foo').stats(); + expect(stats).not.to.be.null; + }); +});