|
| 1 | +"use strict"; |
| 2 | + |
| 3 | +const $RefParser = require("../../.."); |
| 4 | +const helper = require("../../utils/helper"); |
| 5 | +const path = require("../../utils/path"); |
| 6 | +const { expect } = require("chai"); |
| 7 | +// const parsedSchema = require("./parsed"); |
| 8 | +// const dereferencedSchema = require("./dereferenced"); |
| 9 | + |
| 10 | +describe("File names with special characters", () => { |
| 11 | + it("should parse successfully", async () => { |
| 12 | + let parser = new $RefParser(); |
| 13 | + const schema = await parser.dereference(path.rel("specs/extended-ref/base.json")); |
| 14 | + expect(schema).to.equal(parser.schema); |
| 15 | + // expect(schema).to.deep.equal(parsedSchema.schema); |
| 16 | + // expect(parser.$refs.paths()).to.deep.equal([path.abs("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.yaml")]); |
| 17 | + }); |
| 18 | + |
| 19 | + // it("should resolve successfully", helper.testResolve( |
| 20 | + // path.rel("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.yaml"), |
| 21 | + // path.abs("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.yaml"), parsedSchema.schema, |
| 22 | + // path.abs("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.json"), parsedSchema.file |
| 23 | + // )); |
| 24 | + |
| 25 | + // it("should dereference successfully", async () => { |
| 26 | + // let parser = new $RefParser(); |
| 27 | + // const schema = await parser.dereference(path.rel("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.yaml")); |
| 28 | + // expect(schema).to.equal(parser.schema); |
| 29 | + // expect(schema).to.deep.equal(dereferencedSchema); |
| 30 | + // // The "circular" flag should NOT be set |
| 31 | + // expect(parser.$refs.circular).to.equal(false); |
| 32 | + // }); |
| 33 | + |
| 34 | + // it("should bundle successfully", async () => { |
| 35 | + // let parser = new $RefParser(); |
| 36 | + // const schema = await parser.bundle(path.rel("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.yaml")); |
| 37 | + // expect(schema).to.equal(parser.schema); |
| 38 | + // expect(schema).to.deep.equal(dereferencedSchema); |
| 39 | + // }); |
| 40 | +}); |
0 commit comments