You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

16 lines
559 B

import parser from "@shexjs/parser";
import { testData } from "./testData/testData";
import { shexjToTyping } from "../src/typing/shexjToTyping";
import type { Schema } from "shexj";
describe("typing", () => {
testData.forEach(({ name, shexc, successfulTypings }) => {
it(`Creates a typings for ${name}`, async () => {
const schema: Schema = parser
.construct("https://ldo.js.org/")
.parse(shexc);
const [typings] = await shexjToTyping(schema);
expect(typings.typingsString).toBe(successfulTypings);
});
});
});