Skip to content

Commit

Permalink
tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Jul 30, 2024
1 parent d66d248 commit 2f075ac
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions test/explicit-resource-management/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,68 +17,68 @@ async function setUpCollection(client: MongoClient) {
describe('explicit resource management smoke tests', function () {
describe('MongoClient', function () {
it('does not crash or error when used with await-using syntax', async function () {
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();
})
})

describe('Cursors', function () {
it('does not crash or error when used with await-using syntax', async function () {
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();
await client.connect();

const collection = await setUpCollection(client);
const collection = await setUpCollection(client);

await using cursor = collection.find();
await cursor.next();
await cursor.next();
await cursor.next();
await using cursor = collection.find();
await cursor.next();
await cursor.next();
await cursor.next();
})

describe('cursor streams', function() {
it('does not crash or error when used with await-using syntax', async function() {
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();

const collection = await setUpCollection(client);
const collection = await setUpCollection(client);

await using readable = collection.find().stream();
await using readable = collection.find().stream();
})
})
})

describe('Sessions', function () {
it('does not crash or error when used with await-using syntax', async function () {
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();

await using session = client.startSession();
await using session = client.startSession();
})
})

describe('ChangeStreams', function () {
it('does not crash or error when used with await-using syntax', async function () {
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();
await client.connect();

const collection = await setUpCollection(client);
await using cs = collection.watch();
const collection = await setUpCollection(client);
await using cs = collection.watch();

setTimeout(1000).then(() => collection.insertOne({ name: 'bailey' }));
await cs.next();
setTimeout(1000).then(() => collection.insertOne({ name: 'bailey' }));
await cs.next();
})
});

describe('GridFSDownloadStream', function () {
it('does not crash or error when used with await-using syntax', async function () {
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();
await using client = new MongoClient(process.env.MONGODB_URI!);
await client.connect();

const bucket = new GridFSBucket(client.db('foo'));
const uploadStream = bucket.openUploadStream('foo.txt')
await pipeline(Readable.from("AAAAAAA".split('')), uploadStream);
const bucket = new GridFSBucket(client.db('foo'));
const uploadStream = bucket.openUploadStream('foo.txt')
await pipeline(Readable.from("AAAAAAA".split('')), uploadStream);

await using downloadStream = bucket.openDownloadStreamByName('foo.txt');
await using downloadStream = bucket.openDownloadStreamByName('foo.txt');
})
});
})

0 comments on commit 2f075ac

Please sign in to comment.