pagean 8.0.0 → 8.0.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 - 2022 Aaron Goldenthal
3
+ Copyright (c) 2019 - 2023 Aaron Goldenthal
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -142,6 +142,8 @@ For any failing test, the `data` array in the test report includes the original
142
142
  ]
143
143
  ```
144
144
 
145
+ Note: This test will check all links on the page, and does not respect mechanisms inteded to limit web crawlers such as `robots.txt` or `noindex` tags.
146
+
145
147
  ## Reports
146
148
 
147
149
  Based on the `reporters` configuration, Pagean results may be displayed in the console and saved in two reports in the project root directory (any or all of the three):
@@ -254,6 +256,10 @@ Provided with the Pagean project are Docker images configured to run the tests.
254
256
 
255
257
  **Note:** Any images in the `gitlab-ci-utils/pagean/tmp` repository are temporary images used during the build process and may be deleted at any point.
256
258
 
259
+ ### Puppeteer Cache Location
260
+
261
+ In [Puppeteer v19](https://github.com/puppeteer/puppeteer/releases/tag/v19.0.0) the default cache location for installing the Chrome binary was changed from within the project's `node_modules` folder to `~/.cache/puppeteer`. To simplify execution in a container, the `PUPPETEER_CACHE_DIR` environment variable is set to install the Chrome binaries in `/home/pptruser/.cache/puppeteer` during container build, so setting to another value before execution can cause errors where Puppeteer cannot find the Chrome binary.
262
+
257
263
  ## GitLab CI Configuration
258
264
 
259
265
  The following is an example job from a .gitlab-ci.yml file to use this image to run Pagean against another project in GitLab CI:
@@ -25,7 +25,7 @@ const logError = (message, exitOnError = true) => {
25
25
  const outputJsonResults = (configFileName, lintResults) => {
26
26
  // Log JSON to stdout for consistency, and eliminates extraneous stderr
27
27
  // output in PowerShell which produces invalid JSON if piped to file.
28
- // eslint-disable-next-line no-magic-numbers
28
+ // eslint-disable-next-line no-magic-numbers -- index
29
29
  log({ message: JSON.stringify(lintResults.errors, undefined, 2) });
30
30
  if (!lintResults.isValid) {
31
31
  logError(`Errors found in file ${configFileName}`);
package/index.js CHANGED
@@ -60,7 +60,7 @@ const executeAllTests = async (config) => {
60
60
 
61
61
  if (testResults.summary.failed > 0) {
62
62
  // For test harness want process to exit with error code
63
- // eslint-disable-next-line unicorn/no-process-exit, no-process-exit, no-magic-numbers
63
+ // eslint-disable-next-line unicorn/no-process-exit, no-magic-numbers -- exit code
64
64
  process.exit(2);
65
65
  }
66
66
  };
package/lib/link-utils.js CHANGED
@@ -141,7 +141,11 @@ const checkExternalPageLink = async (page, link, useGet = false) => {
141
141
  try {
142
142
  const options = {
143
143
  headers: { 'User-Agent': userAgent },
144
- timeout: timeoutSeconds * msPerSec
144
+ timeout: timeoutSeconds * msPerSec,
145
+ // Axios can generate an error trying to decompress an empty compressed
146
+ // HEAD response, see https://github.com/axios/axios/issues/5102.
147
+ // The response body is also not used, so more efficient to skip.
148
+ decompress: false
145
149
  };
146
150
  // Using internal browser property since not exposed
147
151
  // eslint-disable-next-line no-underscore-dangle
package/lib/reporter.js CHANGED
@@ -14,7 +14,7 @@ const htmlReportFileName = './pagean-results.html';
14
14
  const jsonReportFileName = './pagean-results.json';
15
15
 
16
16
  handlebars.registerHelper('json', (context) => {
17
- // eslint-disable-next-line no-magic-numbers
17
+ // eslint-disable-next-line no-magic-numbers -- count
18
18
  return JSON.stringify(context, undefined, 2);
19
19
  });
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pagean",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
4
4
  "description": "Pagean is a web page analysis tool designed to automate tests requiring web pages to be loaded in a browser window (e.g. horizontal scrollbar, console errors)",
5
5
  "bin": {
6
6
  "pagean": "./bin/pagean.js",
@@ -51,28 +51,28 @@
51
51
  },
52
52
  "homepage": "https://gitlab.com/gitlab-ci-utils/pagean",
53
53
  "devDependencies": {
54
- "@aarongoldenthal/eslint-config-standard": "^17.0.1",
55
- "@aarongoldenthal/stylelint-config-standard": "^11.2.1",
54
+ "@aarongoldenthal/eslint-config-standard": "^19.0.2",
55
+ "@aarongoldenthal/stylelint-config-standard": "^12.0.1",
56
56
  "bin-tester": "^3.0.0",
57
- "eslint": "^8.26.0",
58
- "jest": "^29.2.2",
59
- "jest-junit": "^14.0.1",
60
- "markdownlint-cli": "^0.32.2",
61
- "prettier": "^2.7.1",
57
+ "eslint": "^8.32.0",
58
+ "jest": "^29.3.1",
59
+ "jest-junit": "^15.0.0",
60
+ "markdownlint-cli": "^0.33.0",
61
+ "prettier": "^2.8.3",
62
62
  "strip-ansi": "^6.0.1",
63
- "stylelint": "^14.14.0"
63
+ "stylelint": "^14.16.1"
64
64
  },
65
65
  "dependencies": {
66
- "ajv": "^8.11.0",
66
+ "ajv": "^8.12.0",
67
67
  "ajv-errors": "^3.0.0",
68
- "axios": "^1.1.3",
68
+ "axios": "^1.2.2",
69
69
  "ci-logger": "^5.1.0",
70
- "commander": "^9.4.1",
70
+ "commander": "^10.0.0",
71
71
  "handlebars": "^4.7.7",
72
72
  "htmlhint": "^1.1.4",
73
73
  "kleur": "^4.1.5",
74
74
  "normalize-url": "^6.1.0",
75
75
  "protocolify": "^3.0.0",
76
- "puppeteer": "^19.2.0"
76
+ "puppeteer": "^19.5.2"
77
77
  }
78
78
  }