@jskit-ai/http-web 0.2.46 → 0.2.48

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/http-web",
3
- "version": "0.2.46",
3
+ "version": "0.2.48",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "jskit test"
@@ -52,8 +52,8 @@
52
52
  "peerDependencies": {
53
53
  "@jskit-ai/http-runtime": "0.2.27",
54
54
  "@jskit-ai/kernel": "0.2.27",
55
- "@jskit-ai/realtime": "0.2.42",
56
- "@jskit-ai/shell-web": "0.2.39",
55
+ "@jskit-ai/realtime": "0.2.44",
56
+ "@jskit-ai/shell-web": "0.2.41",
57
57
  "@tanstack/vue-query": "^5.90.5",
58
58
  "vue": "^3.5.13",
59
59
  "vue-router": "^5.0.4",
@@ -1,7 +1,7 @@
1
1
  import assert from "node:assert/strict";
2
2
  import path from "node:path";
3
3
  import process from "node:process";
4
- import test from "node:test";
4
+ import test, { before } from "node:test";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { expect } from "@playwright/test";
7
7
  import { sharedBrowserFixture } from "../../../tooling/testUtils/browserFixture.mjs";
@@ -16,6 +16,8 @@ const SKIP = process.env.JSKIT_HTTP_WEB_PENDING_FOCUS_BROWSER === "1"
16
16
  : "set JSKIT_HTTP_WEB_PENDING_FOCUS_BROWSER=1 to check that pending CRUD buttons keep keyboard focus";
17
17
  const FIXTURE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../fixtures/crud-screens");
18
18
  const open = sharedBrowserFixture({ fixtureRoot: FIXTURE_ROOT });
19
+ // The server compiles the screens before the first test, so its first page load runs warm within its limit.
20
+ if (!SKIP) before(() => open.prepare());
19
21
  // An expanded window: the app bar shows its actions labelled, and the list draws its table.
20
22
  const VIEWPORT = Object.freeze({ width: 1280, height: 900 });
21
23
 
@@ -1,13 +1,9 @@
1
1
  import path from "node:path";
2
2
  import process from "node:process";
3
- import test from "node:test";
3
+ import test, { before } from "node:test";
4
4
  import { fileURLToPath } from "node:url";
5
- import { chromium, expect } from "@playwright/test";
6
- import {
7
- createChromiumLaunchOptions,
8
- startViteFixture,
9
- stopProcess
10
- } from "../../../tooling/testUtils/browserFixture.mjs";
5
+ import { expect } from "@playwright/test";
6
+ import { sharedBrowserFixture } from "../../../tooling/testUtils/browserFixture.mjs";
11
7
  import { expectMaterialBaseline } from "../../../tooling/testUtils/visualBaseline.mjs";
12
8
 
13
9
  const TEST_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));
@@ -122,17 +118,19 @@ async function serveBooks(page, screen) {
122
118
  });
123
119
  }
124
120
 
125
- test("the CRUD screens keep their Material 3 baselines in light and dark at every window size", {
126
- skip: RUN_BROWSER_TEST ? false : "set JSKIT_MATERIAL_BASELINES=1 to check the Material 3 baselines",
127
- timeout: 300_000
128
- }, async (t) => {
129
- // Stopped in after hooks, which run when the test fails or times out too (a body's `finally` doesn't after a
130
- // timeout, and the server and browser would keep the test file's process alive).
131
- const vite = await startViteFixture({ fixtureRoot: FIXTURE_ROOT });
132
- t.after(() => stopProcess(vite));
133
- const browser = await chromium.launch(createChromiumLaunchOptions());
134
- t.after(() => browser.close());
135
- for (const viewport of VIEWPORTS) {
121
+ // One server and one browser for the file, the server warmed before the first test; the tests' ends close their pages
122
+ // and the file's end stops both.
123
+ const open = sharedBrowserFixture({ fixtureRoot: FIXTURE_ROOT });
124
+ if (RUN_BROWSER_TEST) before(() => open.prepare());
125
+
126
+ // A test for each window size, light and dark: 14 page loads, well inside the limit while many browser test files run
127
+ // at once. As one test the 42 loads took 4 to 5 minutes then, at or past its 5 minute limit.
128
+ for (const viewport of VIEWPORTS) {
129
+ test(`the CRUD screens keep their Material 3 baselines in light and dark at ${viewport.width}x${viewport.height}`, {
130
+ skip: RUN_BROWSER_TEST ? false : "set JSKIT_MATERIAL_BASELINES=1 to check the Material 3 baselines",
131
+ timeout: 300_000
132
+ }, async (t) => {
133
+ const { vite, browser } = await open(t);
136
134
  // The app follows the system's light or dark setting, Material 3's default.
137
135
  for (const colorScheme of ["light", "dark"]) {
138
136
  const context = await browser.newContext({
@@ -169,5 +167,5 @@ test("the CRUD screens keep their Material 3 baselines in light and dark at ever
169
167
  await context.close();
170
168
  }
171
169
  }
172
- }
173
- });
170
+ });
171
+ }