...
1{
2 "description": "Test commands: strict mode",
3 "schemaVersion": "1.4",
4 "runOnRequirements": [
5 {
6 "minServerVersion": "4.9",
7 "serverParameters": {
8 "enableTestCommands": true
9 },
10 "serverless": "forbid"
11 }
12 ],
13 "createEntities": [
14 {
15 "client": {
16 "id": "client",
17 "observeEvents": [
18 "commandStartedEvent"
19 ],
20 "serverApi": {
21 "version": "1",
22 "strict": true
23 }
24 }
25 },
26 {
27 "database": {
28 "id": "database",
29 "client": "client",
30 "databaseName": "versioned-api-tests"
31 }
32 }
33 ],
34 "tests": [
35 {
36 "description": "Running a command that is not part of the versioned API results in an error",
37 "operations": [
38 {
39 "name": "runCommand",
40 "object": "database",
41 "arguments": {
42 "commandName": "testVersion2",
43 "command": {
44 "testVersion2": 1
45 }
46 },
47 "expectError": {
48 "isError": true,
49 "errorContains": "command testVersion2 is not in API Version 1",
50 "errorCodeName": "APIStrictError"
51 }
52 }
53 ],
54 "expectEvents": [
55 {
56 "client": "client",
57 "events": [
58 {
59 "commandStartedEvent": {
60 "command": {
61 "testVersion2": 1,
62 "apiVersion": "1",
63 "apiStrict": true,
64 "apiDeprecationErrors": {
65 "$$unsetOrMatches": false
66 }
67 }
68 }
69 }
70 ]
71 }
72 ]
73 }
74 ]
75}
View as plain text