@constructor-io/constructorio-connect-cli
Version:
CLI tool to enable users to interface with the Constructor Connect Ecosystem
39 lines (31 loc) • 1.11 kB
JavaScript
/**
* Check out the documentation to see how to write and maintain tests:
* @see https://docs.constructor.com/docs/integrating-with-constructor-connect-cli-development-flow#step-3-test-your-templates
*/
import { executeTemplate, buildFixture } from "@constructor-io/constructorio-connect-cli";
describe("mapping", () => {
it("should map item groups", async () => {
const result = await executeTemplate({
type: "mapping",
name: "mapping.jsonata",
fixture: buildFixture("mapping", "mapping.json"),
});
expect(result.item_groups).toMatchSnapshot();
});
it("should map items", async () => {
const result = await executeTemplate({
type: "mapping",
name: "mapping.jsonata",
fixture: buildFixture("mapping", "mapping.json"),
});
expect(result.items).toMatchSnapshot();
});
it("should map variations", async () => {
const result = await executeTemplate({
type: "mapping",
name: "mapping.jsonata",
fixture: buildFixture("mapping", "mapping.json"),
});
expect(result.variations).toMatchSnapshot();
});
});