-
Notifications
You must be signed in to change notification settings - Fork 1.8k
refactor(NODE-3717): reorganize tests part 2 #3064
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bb52e8d
refactor(NODE-3717): move crud spec tests to integration
dariakp 0490481
refactor: move crud driver tests to integration
dariakp e406ace
test: fix spec directory path
dariakp 01aae67
refactor: move max staleness test to integration directory
dariakp 6b775d2
refactor: move bulk tests into integration/crud and separate prose test
dariakp 4094c87
refactor: move load balancer spec tests to integration
dariakp baf179c
refactor: move retryable reads tests to integration
dariakp f826dab
refactor: move retryable writes tests to integration
dariakp 8a9f700
refactor: move versioned api test to integration
dariakp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const { expect } = require('chai'); | ||
const { MongoBulkWriteError } = require('../../../src'); | ||
|
||
describe('CRUD Prose Spec Tests', () => { | ||
let client; | ||
|
||
beforeEach(async function () { | ||
client = this.configuration.newClient({ monitorCommands: true }); | ||
await client.connect(); | ||
}); | ||
|
||
afterEach(async () => { | ||
if (client) { | ||
await client.close(); | ||
} | ||
}); | ||
|
||
// Note: This test does not fully implement the described test, it's missing command monitoring assertions | ||
dariakp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
it('2. WriteError.details exposes writeErrors[].errInfo', { | ||
metadata: { requires: { mongodb: '>=5.0.0' } }, | ||
async test() { | ||
try { | ||
await client.db().collection('wc_details').drop(); | ||
} catch { | ||
// don't care | ||
} | ||
|
||
const collection = await client | ||
.db() | ||
.createCollection('wc_details', { validator: { x: { $type: 'string' } } }); | ||
|
||
try { | ||
await collection.insertMany([{ x: /not a string/ }]); | ||
expect.fail('The insert should fail the validation that x must be a string'); | ||
} catch (error) { | ||
expect(error).to.be.instanceOf(MongoBulkWriteError); | ||
expect(error).to.have.property('code', 121); | ||
expect(error).to.have.property('writeErrors').that.is.an('array'); | ||
expect(error.writeErrors[0]).to.have.property('errInfo').that.is.an('object'); | ||
} | ||
} | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
test/functional/crud_api.test.js → test/integration/crud/crud_api.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/functional/load-balancer-spec.test.js → ...oad-balancers/load_balancers.spec.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
test/functional/max_staleness.test.js → ...ation/max-staleness/max_staleness.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
test/functional/retryable_reads.test.js → ...ryable-reads/retryable_reads.spec.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
test/functional/retryable_writes.test.js → ...able-writes/retryable_writes.spec.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/functional/versioned-api.test.js → .../versioned-api/versioned_api.spec.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.