-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathversioned_api.js
More file actions
44 lines (30 loc) · 1.17 KB
/
versioned_api.js
File metadata and controls
44 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use strict';
const { MongoClient } = require('mongodb');
describe('examples.versionedApi:', function () {
let uri;
// eslint-disable-next-line no-unused-vars
let client;
before(function () {
uri = this.configuration.url();
});
it('declare an API version on a client', function () {
// Start Versioned API Example 1
client = new MongoClient(uri, { serverApi: { version: '1' } });
// End Versioned API Example 1
});
it('declare an API version on a client with strict enabled', function () {
// Start Versioned API Example 2
client = new MongoClient(uri, { serverApi: { version: '1', strict: true } });
// End Versioned API Example 2
});
it('declare an API version on a client with strict disabled', function () {
// Start Versioned API Example 3
client = new MongoClient(uri, { serverApi: { version: '1', strict: false } });
// End Versioned API Example 3
});
it('declare an API version on a client with deprecation errors enabled', function () {
// Start Versioned API Example 4
client = new MongoClient(uri, { serverApi: { version: '1', deprecationErrors: true } });
// End Versioned API Example 4
});
});