2.2.11 • Published 5 months ago

@semic/testing v2.2.11

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

@semic/testing

create dev server

import { getDirname } from "@semic/common";
import { createTestServer, initialData } from "@semic/testing";
import { registerInitializer, SqljsInitializer } from "@vendure/testing";
import { config } from "dotenv";
import { SemicAdminPlugin } from "../src/admin.plugin.js";

config();
registerInitializer("sqljs", new SqljsInitializer("__data__"));

const { server } = await createTestServer({
  type: "dev-server",
  metaUrl: import.meta.url,
  overridePlugins: {
    plugins: [
      SemicAdminPlugin.init({
       ...
      }),
    ],
  },
});

await server.init({
  initialData,
  productsCsvPath: getDirname(
    import.meta.url,
    "../../testing/mock-data/products.csv"
  ),
});

create e2e testing server

let server: TestServer;
let shopClient: SimpleGraphQLClient;
let adminClient: SimpleGraphQLClient;
const serverStarted = false;

beforeAll(async () => {
  registerInitializer("sqljs", new SqljsInitializer("__data__"));
  ({ server, adminClient, shopClient } = await createTestServer({
    type: "e2e",
    metaUrl: import.meta.url,
    overridePlugins: {
      plugins: [
        SemicAdminPlugin.init({
          ...
        }),
      ],
    },
  }));

  await server.init({
    initialData,
    productsCsvPath: getDirname(
      import.meta.url,
      "../../testing/mock-data/products.csv"
    ),
  });

  await adminClient.asSuperAdmin();
}, 60000);
2.2.11

5 months ago

2.2.7

7 months ago

2.2.9

6 months ago

2.2.10

6 months ago

2.2.8

7 months ago

2.2.5

7 months ago

2.2.6

7 months ago

2.2.4

8 months ago