Skip to content

Commit

Permalink
test: use path.rel to normalize paths
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed Mar 18, 2024
1 parent 3fb54b4 commit af8a4a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/specs/usage/usage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ describe("Usage", () => {

expect(parser.$refs.propertyMap).to.deep.equal({
"#/properties/books":
path.abs("specs/usage/definitions/design-library.json") +
path.rel(path.abs("specs/usage/definitions/design-library.json")) +
"#/definitions/Books",
"#/properties/books/oneOf/0":
"http://jakub.stoplight-local.com:8080/api/v1/projects/jakub/usage/nodes/reference/book.v1.json",
"#/properties/books/oneOf/1":
"http://jakub.stoplight-local.com:8080/api/v1/projects/jakub/usage/nodes/reference/book.v1.json?mid=1",
"#/properties/books/oneOf/2":
"http://jakub.stoplight-local.com:8080/api/v1/projects/jakub/usage/nodes/reference/book.v2.json",
"#/properties/design-library": path.abs(
"#/properties/design-library": path.rel(path.abs(
"specs/usage/definitions/design-library.json"
),
)),
"#/properties/design-library/definitions/Books":
"http://jakub.stoplight-local.com:8080/api/v1/projects/jakub/usage/nodes/reference/books.json",
});
});

it.skip("bundle with no custom roots should track usage of $refs", async () => {
it("bundle with no custom roots should track usage of $refs", async () => {
let parser = new $RefParser();
await parser.bundle({
properties: {
Expand All @@ -82,8 +82,8 @@ describe("Usage", () => {
});

expect(parser.$refs.propertyMap).to.deep.equal({
"#/properties/bar": path.abs("/") + "#/properties/foo",
"#/properties/baz": path.abs("/") + "#/properties/foo/properties/id",
"#/properties/bar": path.rel(path.abs("/")) + "#/properties/foo",
"#/properties/baz": path.rel(path.abs("/")) + "#/properties/foo/properties/id",
});
});
});

0 comments on commit af8a4a9

Please sign in to comment.