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.
 
 
 

18 lines
685 B

import { testData } from "./testData/testData";
import { shexjToContext } from "../src/context/shexjToContext";
import parser from "@shexjs/parser";
import type { Schema } from "shexj";
describe("context", () => {
testData.forEach(({ name, shexc, successfulContext }) => {
it(`Creates a context for ${name}`, async () => {
const schema: Schema = parser
.construct("https://ldo.js.org/")
.parse(shexc);
// console.log("SCHEMA:", JSON.stringify(schema, null, 2));
const context = await shexjToContext(schema);
// console.log("CONTEXT:", JSON.stringify(context, null, 2));
expect(context).toEqual(successfulContext);
});
});
});