|
1 | 1 | import * as path from 'path';
|
2 | 2 |
|
3 | 3 | import { loadSpecTests } from '../../spec';
|
4 |
| -import { generateTopologyTests, TestRunnerContext } from '../../tools/spec-runner'; |
5 | 4 | import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
|
6 | 5 |
|
7 |
| -describe('Retryable Reads (legacy)', function () { |
8 |
| - const testContext = new TestRunnerContext(); |
9 |
| - const testSuites = loadSpecTests(path.join('retryable-reads', 'legacy')); |
10 |
| - |
11 |
| - after(() => testContext.teardown()); |
12 |
| - |
13 |
| - before(function () { |
14 |
| - return testContext.setup(this.configuration); |
15 |
| - }); |
16 |
| - |
17 |
| - generateTopologyTests(testSuites, testContext, spec => { |
18 |
| - const shouldRun = |
19 |
| - spec.description.match(/distinct/i) || |
20 |
| - spec.description.match(/aggregate/i) || |
21 |
| - spec.description.match(/countDocuments/i) || |
22 |
| - spec.description.match(/listIndexes/i) || |
23 |
| - spec.description.match(/listDatabases/i) || |
24 |
| - spec.description.match(/listDatabaseNames/i) || |
25 |
| - spec.description.match(/listCollections/i) || |
26 |
| - spec.description.match(/listCollectionNames/i) || |
27 |
| - spec.description.match(/estimatedDocumentCount/i) || |
28 |
| - spec.description.match(/count/i) || |
29 |
| - spec.description.match(/find/i); |
30 |
| - |
31 |
| - if (!shouldRun) { |
32 |
| - return 'Test skipped by generic filter.'; |
33 |
| - } |
34 |
| - |
35 |
| - return true; |
36 |
| - }); |
37 |
| -}); |
38 |
| - |
39 | 6 | const UNIMPLEMENTED_APIS = [
|
40 |
| - 'collection.listIndexNames', |
41 |
| - 'database.listCollectionNames', |
42 |
| - 'client.listDatabaseNames' |
| 7 | + 'listIndexNames', |
| 8 | + 'listCollectionNames', |
| 9 | + 'listDatabaseNames', |
| 10 | + 'mapReduce', |
| 11 | + 'listCollectionObjects', |
| 12 | + 'listDatabaseObjects' |
43 | 13 | ];
|
44 | 14 |
|
45 | 15 | describe('Retryable Reads (unified)', function () {
|
46 | 16 | runUnifiedSuite(loadSpecTests(path.join('retryable-reads', 'unified')), ({ description }) => {
|
47 | 17 | for (const apiName of UNIMPLEMENTED_APIS) {
|
48 |
| - if (description.startsWith(apiName)) { |
| 18 | + if (description.toLowerCase().includes(apiName.toLowerCase())) { |
49 | 19 | return `The Node.js Driver does not support ${apiName}`;
|
50 | 20 | }
|
51 | 21 | }
|
|
0 commit comments