lighthouse-reporting 1.6.7 → 1.6.9
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/dist/constants-CFLum58k.js +6 -0
- package/dist/constants-WB1XbOZm.cjs +23 -0
- package/dist/hooks.cjs +21 -18
- package/dist/hooks.js +13 -16
- package/dist/index.cjs +13 -14
- package/dist/index.js +1 -11
- package/dist/lighthouse-reporting.umd.cjs +279 -279
- package/dist/lighthouseReports.cjs +82 -84
- package/dist/lighthouseReports.js +78 -88
- package/dist/playwrightLighthouseTest.cjs +20 -28
- package/dist/playwrightLighthouseTest.d.ts +2 -2
- package/dist/playwrightLighthouseTest.js +14 -27
- package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/dist/storybookPlaywright.cjs +27 -30
- package/dist/storybookPlaywright.d.ts +3 -3
- package/dist/storybookPlaywright.js +24 -30
- package/package.json +20 -19
- package/dist/constants-ClvZzVIQ.cjs +0 -7
- package/dist/constants-CvRW9vHz.js +0 -8
- /package/dist/{lighthouse.html → src/lighthouse.html} +0 -0
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
import fse from "fs-extra";
|
|
2
2
|
import { expect } from "@playwright/test";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (actionBeforeScreenshot) {
|
|
26
|
-
await actionBeforeScreenshot(page);
|
|
27
|
-
}
|
|
28
|
-
await expect(page).toHaveScreenshot(`${story.id}.png`, screenshotOptions);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
storybookPlaywright
|
|
3
|
+
//#region src/storybookPlaywright.ts
|
|
4
|
+
var storybookPlaywright = {
|
|
5
|
+
getStories: (pathToStorybookIndexJson, storyFilterFn) => {
|
|
6
|
+
if (!fse.existsSync(pathToStorybookIndexJson)) {
|
|
7
|
+
console.log(pathToStorybookIndexJson, "doesn't exist.");
|
|
8
|
+
throw new Error("Please build storybook before running tests!");
|
|
9
|
+
}
|
|
10
|
+
const storybookIndexJson = fse.readJsonSync(pathToStorybookIndexJson);
|
|
11
|
+
const storyObject = storybookIndexJson.entries || storybookIndexJson.stories;
|
|
12
|
+
return Object.values(storyObject).filter(storyFilterFn);
|
|
13
|
+
},
|
|
14
|
+
captureScreenshot: async (story, context, screenshotOptions, options = { waitForLoadStateTimeout: 2e3 }, actionBeforeScreenshot) => {
|
|
15
|
+
const page = context.pages()[0];
|
|
16
|
+
await page.goto(`/iframe.html?id=${story.id}`);
|
|
17
|
+
await expect(page.locator(".sb-show-main")).toBeVisible();
|
|
18
|
+
await expect(page.locator(".sb-show-errordisplay")).not.toBeVisible();
|
|
19
|
+
try {
|
|
20
|
+
await page.waitForLoadState("networkidle", { timeout: options.waitForLoadStateTimeout });
|
|
21
|
+
} catch {}
|
|
22
|
+
if (actionBeforeScreenshot) await actionBeforeScreenshot(page);
|
|
23
|
+
await expect(page).toHaveScreenshot(`${story.id}.png`, screenshotOptions);
|
|
24
|
+
}
|
|
33
25
|
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { storybookPlaywright };
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse-reporting",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build && vite build -c vite.umd.config.ts && tsc -p ./tsconfig.build.json",
|
|
7
7
|
"compile": "tsc",
|
|
8
|
-
"lint": "eslint
|
|
8
|
+
"lint": "eslint .",
|
|
9
9
|
"precommit": "run-p lint compile",
|
|
10
10
|
"semantic-release": "semantic-release"
|
|
11
11
|
},
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
20
21
|
"import": "./dist/index.js",
|
|
21
22
|
"require": "./dist/lighthouse-reporting.umd.cjs",
|
|
22
|
-
"default": "./dist/index.cjs"
|
|
23
|
-
"types": "./dist/index.d.ts"
|
|
23
|
+
"default": "./dist/index.cjs"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
@@ -28,25 +28,26 @@
|
|
|
28
28
|
"get-port": ">=7"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@
|
|
31
|
+
"@eslint/js": "^10.0.1",
|
|
32
|
+
"@playwright/test": "^1.54.2",
|
|
32
33
|
"@types/fs-extra": "^11.0.4",
|
|
33
|
-
"@types/node": "^
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
35
|
-
"@typescript-eslint/parser": "^
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"eslint-config-prettier": "^
|
|
38
|
-
"eslint-plugin-prettier": "^5.
|
|
39
|
-
"get-port": "^7.
|
|
40
|
-
"husky": "^9.
|
|
34
|
+
"@types/node": "^24.13.2",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
|
36
|
+
"@typescript-eslint/parser": "^8.62.0",
|
|
37
|
+
"eslint": "^10.5.0",
|
|
38
|
+
"eslint-config-prettier": "^10.1.8",
|
|
39
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
40
|
+
"get-port": "^7.1.0",
|
|
41
|
+
"husky": "^9.1.7",
|
|
41
42
|
"npm-run-all": "^4.1.5",
|
|
42
|
-
"prettier": "^3.
|
|
43
|
-
"semantic-release": "^
|
|
44
|
-
"typescript": "^5.
|
|
45
|
-
"vite": "^
|
|
46
|
-
"vite-plugin-static-copy": "^1.
|
|
43
|
+
"prettier": "^3.8.4",
|
|
44
|
+
"semantic-release": "^25.0.5",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"vite": "^8.1.0",
|
|
47
|
+
"vite-plugin-static-copy": "^4.1.1"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"fs-extra": "^11.
|
|
50
|
+
"fs-extra": "^11.3.5"
|
|
50
51
|
},
|
|
51
52
|
"repository": {
|
|
52
53
|
"type": "git",
|
|
File without changes
|