@dargmuesli/nuxt-vio-testing 21.0.0-beta.9 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import * as _playwright_test0 from "@playwright/test";
1
+ import * as _$_playwright_test0 from "@playwright/test";
2
2
  import { Page } from "@playwright/test";
3
3
 
4
4
  //#region e2e/fixtures/vioTest.d.ts
@@ -9,9 +9,9 @@ declare const createDefaultPage: (page: Page) => {
9
9
  isLoading?: boolean;
10
10
  }) => Promise<void>;
11
11
  };
12
- declare const vioTest: _playwright_test0.TestType<_playwright_test0.PlaywrightTestArgs & _playwright_test0.PlaywrightTestOptions & {
12
+ declare const vioTest: _$_playwright_test0.TestType<_$_playwright_test0.PlaywrightTestArgs & _$_playwright_test0.PlaywrightTestOptions & {
13
13
  defaultPage: ReturnType<typeof createDefaultPage>;
14
14
  _autoSnapshotSuffix: unknown;
15
- }, _playwright_test0.PlaywrightWorkerArgs & _playwright_test0.PlaywrightWorkerOptions>;
15
+ }, _$_playwright_test0.PlaywrightWorkerArgs & _$_playwright_test0.PlaywrightWorkerOptions>;
16
16
  //#endregion
17
17
  export { vioTest };
@@ -1,5 +1,4 @@
1
1
  import { expect, test } from "@playwright/test";
2
-
3
2
  //#region e2e/fixtures/vioTest.ts
4
3
  const createDefaultPage = (page) => {
5
4
  return {
@@ -33,6 +32,5 @@ const vioTest = test.extend({ defaultPage: async ({ page, context }, use) => {
33
32
  ]);
34
33
  await use(createDefaultPage(page));
35
34
  } });
36
-
37
35
  //#endregion
38
- export { vioTest };
36
+ export { vioTest };
@@ -1,5 +1,4 @@
1
1
  import { expect } from "@playwright/test";
2
-
3
2
  //#region e2e/utils/constants.ts
4
3
  const TIMEOUT = 6e4;
5
4
  const PAGE_READY = async ({ page, options }) => {
@@ -7,6 +6,5 @@ const PAGE_READY = async ({ page, options }) => {
7
6
  if (!options || options.isLoading !== false) await expect(page.getByTestId("is-loading")).toHaveAttribute("data-is-loading", "false");
8
7
  };
9
8
  const SITE_URL = process.env.NUXT_PUBLIC_I18N_BASE_URL || `https://${process.env.HOST || "app.localhost"}:${process.env.PORT || "3000"}`;
10
-
11
9
  //#endregion
12
- export { PAGE_READY, SITE_URL, TIMEOUT };
10
+ export { PAGE_READY, SITE_URL, TIMEOUT };
@@ -11,7 +11,10 @@ declare const testMetadata: ({
11
11
  path: string;
12
12
  title: string;
13
13
  }) => Promise<void>;
14
- declare const testOgImage: (paths: Record<string, string>) => void;
14
+ declare const testOgImage: (paths: {
15
+ static?: Record<string, string>;
16
+ dynamic?: Record<string, string>;
17
+ }) => void;
15
18
  declare const testPageLoad: (url: string, status?: number) => void;
16
19
  declare const testVisualRegression: (url: string, plain?: boolean) => void;
17
20
  //#endregion
@@ -3,7 +3,6 @@ import { vioTest } from "../fixtures/vioTest.mjs";
3
3
  import { expect } from "@playwright/test";
4
4
  import AxeBuilder from "@axe-core/playwright";
5
5
  import { joinURL, withoutTrailingSlash } from "ufo";
6
-
7
6
  //#region e2e/utils/tests.ts
8
7
  const testA11y = (url) => vioTest.describe("a11y", () => {
9
8
  vioTest("should not have any automatically detectable accessibility issues", async ({ defaultPage }) => {
@@ -433,9 +432,13 @@ const testMetadata = async ({ page, path, title }) => {
433
432
  };
434
433
  const testOgImage = (paths) => vioTest.describe("visual regression", () => {
435
434
  vioTest("generates the open graph image", async ({ page }) => {
436
- await page.goto(joinURL(`/_og/${process.env.VIO_SERVER === "static" ? "s" : "d"}/${paths.en}`));
435
+ const isStaticServer = process.env.VIO_SERVER === "static";
436
+ const serverPaths = isStaticServer ? paths.static : paths.dynamic;
437
+ if (!serverPaths) throw new Error(isStaticServer ? "Static paths must be provided for static server tests" : "Dynamic paths must be provided for dynamic server tests");
438
+ const serverPrefix = isStaticServer ? "s" : "d";
439
+ await page.goto(joinURL(`/_og/${serverPrefix}/${serverPaths.en}`));
437
440
  await expect(page).toHaveScreenshot();
438
- await page.goto(joinURL(`/_og/${process.env.VIO_SERVER === "static" ? "s" : "d"}/${paths.de}`));
441
+ await page.goto(joinURL(`/_og/${serverPrefix}/${serverPaths.de}`));
439
442
  await expect(page).toHaveScreenshot();
440
443
  });
441
444
  });
@@ -450,6 +453,5 @@ const testVisualRegression = (url, plain) => vioTest.describe("visual regression
450
453
  await expect(plain ? page : defaultPage.page).toHaveScreenshot({ timeout: TIMEOUT });
451
454
  });
452
455
  });
453
-
454
456
  //#endregion
455
- export { testA11y, testMetadata, testOgImage, testPageLoad, testVisualRegression };
457
+ export { testA11y, testMetadata, testOgImage, testPageLoad, testVisualRegression };
@@ -1,4 +1,4 @@
1
- import * as _playwright_test0 from "@playwright/test";
1
+ import * as _$_playwright_test0 from "@playwright/test";
2
2
 
3
3
  //#region playwright.config.d.ts
4
4
  /**
@@ -8,6 +8,6 @@ import * as _playwright_test0 from "@playwright/test";
8
8
  /**
9
9
  * See https://playwright.dev/docs/test-configuration.
10
10
  */
11
- declare const _default: _playwright_test0.PlaywrightTestConfig<{}, {}>;
11
+ declare const _default: _$_playwright_test0.PlaywrightTestConfig<{}, {}>;
12
12
  //#endregion
13
13
  export { _default as default };
@@ -1,6 +1,5 @@
1
1
  import { SITE_URL, TIMEOUT } from "./e2e/utils/constants.mjs";
2
2
  import { defineConfig, devices } from "@playwright/test";
3
-
4
3
  //#region playwright.config.ts
5
4
  /**
6
5
  * Read environment variables from file.
@@ -46,6 +45,5 @@ var playwright_config_default = defineConfig({
46
45
  },
47
46
  workers: void 0
48
47
  });
49
-
50
48
  //#endregion
51
- export { playwright_config_default as default };
49
+ export { playwright_config_default as default };
package/package.json CHANGED
@@ -3,16 +3,17 @@
3
3
  "@axe-core/playwright": "4.11.1",
4
4
  "@eslint/js": "10.0.1",
5
5
  "@playwright/test": "1.58.2",
6
- "@types/node": "24.10.14",
6
+ "@types/lodash-es": "4.17.12",
7
+ "@types/node": "24.12.0",
7
8
  "cross-env": "10.1.0",
8
- "eslint": "10.0.2",
9
+ "eslint": "10.1.0",
9
10
  "eslint-config-prettier": "10.1.8",
10
11
  "eslint-plugin-prettier": "5.5.5",
11
12
  "lodash-es": "4.17.23",
12
13
  "playwright-core": "1.58.2",
13
- "tsdown": "0.20.3",
14
- "typescript": "5.9.3",
15
- "typescript-eslint": "8.56.1",
14
+ "tsdown": "0.21.7",
15
+ "typescript": "6.0.2",
16
+ "typescript-eslint": "8.57.2",
16
17
  "ufo": "1.6.3"
17
18
  },
18
19
  "engines": {
@@ -65,7 +66,7 @@
65
66
  "test:e2e": "playwright test",
66
67
  "test:e2e:docker:br": "pnpm run test:e2e:docker:build && pnpm run test:e2e:docker:run",
67
68
  "test:e2e:docker:build": "sudo docker build -t test-e2e_development --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --target test-e2e_development ..",
68
- "test:e2e:docker:run": "sudo docker run --rm --add-host=app.localhost:127.0.0.1 -v \"$PWD/..:/srv/app\" -v \"jonas-thelemann_playwright_data:/srv/app/node_modules\" -v \"$(pnpm store path):/srv/.pnpm-store\" test-e2e_development",
69
+ "test:e2e:docker:run": "sudo docker run --add-host=app.localhost:127.0.0.1 --rm -v \"$PWD/..:/srv/app\" -v \"jonas-thelemann_playwright_data:/srv/app/node_modules\" -v \"$(pnpm store path):/srv/.pnpm-store\" test-e2e_development",
69
70
  "test:e2e:docker:server:dev": "pnpm run test:e2e:docker:br pnpm run --dir tests test:e2e:server:dev",
70
71
  "test:e2e:docker:server:dev:update": "pnpm run test:e2e:docker:server:dev --update-snapshots",
71
72
  "test:e2e:docker:server:node": "pnpm run test:e2e:docker:br pnpm run --dir tests test:e2e:server:node",
@@ -77,5 +78,5 @@
77
78
  "test:e2e:server:static": "cross-env NUXT_PUBLIC_I18N_BASE_URL=https://app.localhost:3002 PORT=3002 VIO_SERVER=static pnpm run test:e2e"
78
79
  },
79
80
  "type": "module",
80
- "version": "21.0.0-beta.9"
81
+ "version": "21.0.0"
81
82
  }