Skip to content

Commit fd4a28a

Browse files
Azzam1503jdesrosiers
authored andcommitted
updated get-dialect-ids.spec.ts
1 parent 98bbd96 commit fd4a28a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

lib/get-dialect-ids.spec.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { test, expect, describe } from "vitest";
2-
import { getDialectIds, loadDialect } from "./keywords.js";
2+
import { getDialectIds } from "./experimental.js";
3+
import { registerSchema } from "./schema.js";
34
import "../draft-2020-12";
45
import "../draft-2019-09";
56
import "../draft-04";
@@ -34,14 +35,13 @@ describe("getDialectIds function", () => {
3435
});
3536

3637
test("returns an array of dialect identifiers that are either imported in the file or loaded as custom dialects", () => {
37-
//Load some dialects before each test
38-
loadDialect("http://example.com/dialect1", {
39-
"https://json-schema.org/draft/2020-12/vocab/core": true,
40-
"https://json-schema.org/draft/2020-12/vocab/applicator": true
41-
});
42-
loadDialect("http://example.com/dialect2", {
43-
"https://json-schema.org/draft/2020-12/vocab/core": true,
44-
"https://json-schema.org/draft/2020-12/vocab/applicator": true
38+
registerSchema({
39+
"$id": "http://example.com/dialect1",
40+
"$schema": "https://json-schema.org/draft/2020-12/schema",
41+
"$vocabulary": {
42+
"https://json-schema.org/draft/2020-12/vocab/core": true,
43+
"https://json-schema.org/draft/2020-12/vocab/applicator": true
44+
}
4545
});
4646
const dialectIds = getDialectIds();
4747
expect(dialectIds).toEqual([
@@ -61,8 +61,7 @@ describe("getDialectIds function", () => {
6161
"https://spec.openapis.org/oas/3.1/schema-draft-06",
6262
"https://spec.openapis.org/oas/3.1/schema-draft-04",
6363
"https://json-schema.org/validation",
64-
"http://example.com/dialect1",
65-
"http://example.com/dialect2"
64+
"http://example.com/dialect1"
6665
]);
6766
});
6867
});

0 commit comments

Comments
 (0)