Skip to content

Commit 7144c66

Browse files
committed
Fix annotation type and test runner bugs
1 parent e6f25e8 commit 7144c66

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

annotations/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { OutputFormat, Output, ValidationOptions } from "../lib/index.js";
22
import type { CompiledSchema } from "../lib/experimental.js";
3-
import type { JsonNode } from "../lib/json-node.js";
3+
import type { JsonNode } from "../lib/instance.js";
44
import type { Json } from "@hyperjump/json-pointer";
55

66

annotations/index.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,14 @@ const testRunner = (version: number, dialect: string) => {
7878
let instance: JsonNode;
7979

8080
beforeEach(() => {
81-
// TODO: What's wrong with the type?
82-
instance = annotator(subject.instance); // eslint-disable-line @typescript-eslint/no-unsafe-assignment
81+
instance = annotator(subject.instance);
8382
});
8483

8584
for (const assertion of subject.assertions) {
8685
test(`${assertion.keyword} annotations at '${assertion.location}' should be ${JSON.stringify(assertion.expected)}`, () => {
87-
const dialect: string | undefined = testCase.schema.$schema ? toAbsoluteIri(testCase.schema.$schema as string) : undefined;
86+
const schemaDialect: string | undefined = testCase.schema.$schema ? toAbsoluteIri(testCase.schema.$schema as string) : dialect;
8887
const subject = Instance.get(`#${assertion.location}`, instance);
89-
const annotations = subject ? Instance.annotation(subject, assertion.keyword, dialect) : [];
88+
const annotations = subject ? Instance.annotation(subject, assertion.keyword, schemaDialect) : [];
9089
expect(annotations).to.eql(Object.values(assertion.expected));
9190
});
9291
}

0 commit comments

Comments
 (0)