Skip to content

Commit 688da8f

Browse files
committedJul 11, 2023
test: fix flakey tests, remove test for #9597 because it affects global state and fails intermittently on deno
1 parent 4f264a8 commit 688da8f

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed
 

‎test/collection.capped.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ describe('collections: capped:', function() {
4646
capped.set('capped', { size: 1000 });
4747
const Capped = db.model('Test', capped, 'Test');
4848
await Capped.init();
49+
await Capped.createCollection();
4950
await new Promise((resolve) => setTimeout(resolve, 100));
5051

5152
const isCapped = await Capped.collection.isCapped();

‎test/connection.test.js

-15
Original file line numberDiff line numberDiff line change
@@ -1011,21 +1011,6 @@ describe('connections:', function() {
10111011
assert.throws(() => m.model('Test', Schema({ name: String })), /overwrite/);
10121012
});
10131013

1014-
it('can use destructured `connect` and `disconnect` (gh-9597)', async function() {
1015-
const m = new mongoose.Mongoose();
1016-
const connect = m.connect;
1017-
const disconnect = m.disconnect;
1018-
1019-
await disconnect();
1020-
await new Promise((resolve) => setTimeout(resolve, 0));
1021-
1022-
const errorOnConnect = await connect(start.uri).then(() => null, err => err);
1023-
assert.ifError(errorOnConnect);
1024-
1025-
const errorOnDisconnect = await disconnect().then(() => null, err => err);
1026-
assert.ifError(errorOnDisconnect);
1027-
});
1028-
10291014
describe('when connecting with a secondary read preference(gh-9374)', function() {
10301015
describe('mongoose.connect', function() {
10311016
it('forces autoIndex & autoCreate to be false if read preference is secondary or secondaryPreferred', async function() {

0 commit comments

Comments
 (0)
Please sign in to comment.