Skip to content

Commit 641d8ee

Browse files
committed
Fixed tests on the path's format
1 parent 7776269 commit 641d8ee

11 files changed

+20
-20
lines changed

src/test/additionalPropertiesIsBooleanTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test("Additional Properties is boolean", async () => {
3838
mode: "Addition",
3939
new: {
4040
location: ``,
41-
path: "paths./api/Operations.get.parameters",
41+
path: "paths['/api/Operations'].get.parameters",
4242
ref: ``
4343
},
4444
old: {},

src/test/commonParametersTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test("common-parameters", async () => {
3939
new: {},
4040
old: {
4141
location: "",
42-
path: "paths./api/Operations.get.parameters",
42+
path: "paths['/api/Operations'].get.parameters",
4343
ref: ""
4444
},
4545
type: "Error"
@@ -52,7 +52,7 @@ test("common-parameters", async () => {
5252
mode: "Addition",
5353
new: {
5454
location: "",
55-
path: "paths./api/Operations.get.parameters",
55+
path: "paths['/api/Operations'].get.parameters",
5656
ref: ""
5757
},
5858
old: {},

src/test/expandsAllOfFullCoversTest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ test("expands allOf full covers", async () => {
3636
message: "The new version has a different 'allOf' property than the previous one.",
3737
old: {
3838
ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
39-
path: "paths./api/Parameters.put.parameters[0].schema",
39+
path: "paths['/api/Parameters'].put.parameters[0].schema",
4040
location: `${oldFilePath}:22:13`
4141
},
4242
new: {
4343
ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
44-
path: "paths./api/Parameters.put.parameters[0].schema",
44+
path: "paths['/api/Parameters'].put.parameters[0].schema",
4545
location: `${newFilePath}:22:13`
4646
},
4747
type: "Error",
@@ -109,12 +109,12 @@ test("expands allOf full covers", async () => {
109109
"The new version lists new non-read-only properties as required: 'a'. These properties were not listed as required in the old version.",
110110
old: {
111111
ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
112-
path: "paths./api/Parameters.put.parameters[0].schema",
112+
path: "paths['/api/Parameters'].put.parameters[0].schema",
113113
location: `${oldFilePath}:22:13`
114114
},
115115
new: {
116116
ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
117-
path: "paths./api/Parameters.put.parameters[0].schema",
117+
path: "paths['/api/Parameters'].put.parameters[0].schema",
118118
location: `${newFilePath}:22:13`
119119
},
120120
type: "Error",

src/test/expandsAllOfModelsTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ test("expands allOf Models", async () => {
3636
message: "The new version has a different 'allOf' property than the previous one.",
3737
old: {
3838
ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
39-
path: "paths./api/Parameters.put.parameters[0].schema",
39+
path: "paths['/api/Parameters'].put.parameters[0].schema",
4040
location: `${oldFilePath}:24:13`
4141
},
4242
new: {
4343
ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
44-
path: "paths./api/Parameters.put.parameters[0].schema",
44+
path: "paths['/api/Parameters'].put.parameters[0].schema",
4545
location: `${newFilePath}:24:13`
4646
},
4747
type: "Error",

src/test/fullReversedTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test("full reversed", async () => {
3939
mode: "Removal",
4040
old: {
4141
location: `${oldFilePath2}:8:5`,
42-
path: "paths./x",
42+
path: "paths['/x']",
4343
ref: `${oldFilePath2}#/paths/~1x`
4444
},
4545
new: {},

src/test/fullTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test("full", async () => {
3939
mode: "Addition",
4040
new: {
4141
location: `${newFilePath2}:8:5`,
42-
path: "paths./x",
42+
path: "paths['/x']",
4343
ref: `${newFilePath2}#/paths/~1x`
4444
},
4545
old: {},

src/test/moveIntoAllOfModelsTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ test("Move into allOf Models", async () => {
3636
message: "The new version has a different 'allOf' property than the previous one.",
3737
old: {
3838
ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
39-
path: "paths./api/Parameters.put.parameters[0].schema",
39+
path: "paths['/api/Parameters'].put.parameters[0].schema",
4040
location: `${oldFilePath}:24:13`
4141
},
4242
new: {
4343
ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
44-
path: "paths./api/Parameters.put.parameters[0].schema",
44+
path: "paths['/api/Parameters'].put.parameters[0].schema",
4545
location: `${newFilePath}:24:13`
4646
},
4747
type: "Error",

src/test/multipleLevelAllOfTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ test("Multiple Level AllOf", async () => {
3636
message: "The new version has a different 'allOf' property than the previous one.",
3737
old: {
3838
ref: `${oldFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
39-
path: "paths./api/Parameters.put.parameters[0].schema",
39+
path: "paths['/api/Parameters'].put.parameters[0].schema",
4040
location: `${oldFilePath}:24:13`
4141
},
4242
new: {
4343
ref: `${newFilePath}#/paths/~1api~1Parameters/put/parameters/0/schema`,
44-
path: "paths./api/Parameters.put.parameters[0].schema",
44+
path: "paths['/api/Parameters'].put.parameters[0].schema",
4545
location: `${newFilePath}:24:13`
4646
},
4747
type: "Error",

src/test/requestBodyFormatNoLongerSupportedTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ test("flags 1003 - RequestBodyFormatNoLongerSupported", async () => {
1919
mode: "Removal",
2020
old: {
2121
ref: `${oldFilePath}#/consumes`,
22-
path: "paths./pets.post.consumes",
22+
path: "paths['/pets'].post.consumes",
2323
location: `${oldFilePath}:7:3`
2424
},
2525
new: {
2626
ref: `${newFilePath}#/consumes`,
27-
path: "paths./pets.post.consumes",
27+
path: "paths['/pets'].post.consumes",
2828
location: `${newFilePath}:7:3`
2929
},
3030
type: "Warning",

src/test/responseBodyFormatNowSupportedTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ test("flags 1004 - ResponseBodyFormatNowSupported", async () => {
1919
mode: "Addition",
2020
old: {
2121
ref: `${oldFilePath}#/produces`,
22-
path: "paths./pets.get.produces",
22+
path: "paths['/pets'].get.produces",
2323
location: `${oldFilePath}:7:3`
2424
},
2525
new: {
2626
ref: `${newFilePath}#/produces`,
27-
path: "paths./pets.get.produces",
27+
path: "paths['/pets'].get.produces",
2828
location: `${newFilePath}:7:3`
2929
},
3030
type: "Warning",

0 commit comments

Comments
 (0)