-
Notifications
You must be signed in to change notification settings - Fork 2
feat(NODE-4559): add mongodb-legacy metadata #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
ff54a8f
c05f31c
94b2b38
a4dd864
62182b3
b1d8b9a
33845a6
816c1bb
ebe769c
39e6c55
0274944
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,24 @@ describe('legacy_wrappers/mongo_client.js', () => { | |
| await client.close(); | ||
| }); | ||
|
|
||
| describe('client metadata', () => { | ||
| it('should set mongodb-legacy to the client metadata', () => { | ||
|
||
| const client = new LegacyMongoClient(iLoveJs); | ||
| expect(client.options) | ||
| .to.have.nested.property('metadata.driver.name') | ||
| .to.be.a('string') | ||
| .that.includes('mongodb-legacy'); | ||
| }); | ||
|
|
||
| it('should add mongodb-legacy to existing driverInfo.name', () => { | ||
| const client = new LegacyMongoClient(iLoveJs, { driverInfo: { name: 'mongoose' } }); | ||
| expect(client.options) | ||
| .to.have.nested.property('metadata.driver.name') | ||
| .to.be.a('string') | ||
| .that.includes('mongoose|mongodb-legacy'); | ||
| }); | ||
| }); | ||
|
|
||
baileympearson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| it('calling MongoClient.connect() returns promise', async () => { | ||
| sinon.stub(mongodbDriver.MongoClient.prototype, 'connect').returns(Promise.resolve(2)); | ||
| expect(client).to.have.property('connect').that.is.a('function'); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.