@parameter1/base-cms-marko-web 4.5.4 → 4.5.5
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/components/browser-component.marko.js +2 -2
- package/components/document/components/body-wrapper.marko.js +2 -2
- package/components/document/components/error.marko.js +2 -2
- package/components/document/components/live-reload.marko.js +2 -2
- package/components/document/components/polyfill.marko.js +2 -2
- package/components/document/container.marko.js +2 -2
- package/components/document/index.marko.js +2 -2
- package/components/element/array.marko.js +2 -2
- package/components/element/audio.marko.js +2 -2
- package/components/element/block.marko.js +2 -2
- package/components/element/clear.marko.js +2 -2
- package/components/element/components/image.marko.js +2 -2
- package/components/element/components/text.marko.js +2 -2
- package/components/element/content/address1.marko.js +2 -2
- package/components/element/content/address2.marko.js +2 -2
- package/components/element/content/audio.marko.js +2 -2
- package/components/element/content/authors.marko.js +2 -2
- package/components/element/content/body.marko.js +2 -2
- package/components/element/content/byline.marko.js +2 -2
- package/components/element/content/city-state-zip.marko.js +2 -2
- package/components/element/content/contributors.marko.js +2 -2
- package/components/element/content/country.marko.js +2 -2
- package/components/element/content/embed-code.marko.js +2 -2
- package/components/element/content/end-date.marko.js +2 -2
- package/components/element/content/ends.marko.js +2 -2
- package/components/element/content/fax.marko.js +2 -2
- package/components/element/content/images.marko.js +2 -2
- package/components/element/content/mobile.marko.js +2 -2
- package/components/element/content/name.marko.js +2 -2
- package/components/element/content/phone.marko.js +2 -2
- package/components/element/content/photographers.marko.js +2 -2
- package/components/element/content/public-email.marko.js +2 -2
- package/components/element/content/published.marko.js +2 -2
- package/components/element/content/short-name.marko.js +2 -2
- package/components/element/content/sidebar-stubs.marko.js +2 -2
- package/components/element/content/sidebars.marko.js +2 -2
- package/components/element/content/source.marko.js +2 -2
- package/components/element/content/sponsors.marko.js +2 -2
- package/components/element/content/start-date.marko.js +2 -2
- package/components/element/content/starts.marko.js +2 -2
- package/components/element/content/teaser.marko.js +2 -2
- package/components/element/content/title.marko.js +2 -2
- package/components/element/content/tollfree.marko.js +2 -2
- package/components/element/content/transcript.marko.js +2 -2
- package/components/element/content/website.marko.js +2 -2
- package/components/element/date.marko.js +2 -2
- package/components/element/image/caption.marko.js +2 -2
- package/components/element/image/credit.marko.js +2 -2
- package/components/element/image/display-name.marko.js +2 -2
- package/components/element/image/slider.marko.js +2 -2
- package/components/element/img.marko.js +2 -2
- package/components/element/index.marko.js +2 -2
- package/components/element/link.marko.js +2 -2
- package/components/element/magazine-issue/description.marko.js +2 -2
- package/components/element/magazine-issue/digital-edition-url.marko.js +2 -2
- package/components/element/magazine-issue/name.marko.js +2 -2
- package/components/element/magazine-issue/pdf-url.marko.js +2 -2
- package/components/element/magazine-publication/cancel-url.marko.js +2 -2
- package/components/element/magazine-publication/change-address-url.marko.js +2 -2
- package/components/element/magazine-publication/description.marko.js +2 -2
- package/components/element/magazine-publication/einquiry-url.marko.js +2 -2
- package/components/element/magazine-publication/name.marko.js +2 -2
- package/components/element/magazine-publication/renewal-url.marko.js +2 -2
- package/components/element/magazine-publication/reprints-url.marko.js +2 -2
- package/components/element/magazine-publication/subscribe-url.marko.js +2 -2
- package/components/element/obj-array.marko.js +2 -2
- package/components/element/obj-audio.marko.js +2 -2
- package/components/element/obj-date.marko.js +2 -2
- package/components/element/obj-nodes.marko.js +2 -2
- package/components/element/obj-text.marko.js +2 -2
- package/components/element/obj.marko.js +2 -2
- package/components/element/picture.marko.js +2 -2
- package/components/element/text.marko.js +2 -2
- package/components/element/website-section/description.marko.js +2 -2
- package/components/element/website-section/hierarchy.marko.js +2 -2
- package/components/element/website-section/name.marko.js +2 -2
- package/components/load-more/index.marko.js +2 -2
- package/components/load-more/trigger.marko.js +2 -2
- package/components/node/body.marko.js +2 -2
- package/components/node/element.marko.js +2 -2
- package/components/node/footer.marko.js +2 -2
- package/components/node/header.marko.js +2 -2
- package/components/node/image-inner-wrapper.marko.js +2 -2
- package/components/node/image-wrapper.marko.js +2 -2
- package/components/node/image.marko.js +2 -2
- package/components/node/index.marko.js +2 -2
- package/components/node-list/body.marko.js +2 -2
- package/components/node-list/element.marko.js +2 -2
- package/components/node-list/footer.marko.js +2 -2
- package/components/node-list/header.marko.js +2 -2
- package/components/node-list/index.marko.js +2 -2
- package/components/node-list/node.marko.js +2 -2
- package/components/node-list/nodes.marko.js +2 -2
- package/components/page/container.marko.js +2 -2
- package/components/page/description.marko.js +2 -2
- package/components/page/image.marko.js +2 -2
- package/components/page/layouts/content.marko.js +2 -2
- package/components/page/layouts/default.marko.js +2 -2
- package/components/page/layouts/dynamic-page.marko.js +2 -2
- package/components/page/layouts/magazine-issue.marko.js +2 -2
- package/components/page/layouts/magazine-publication.marko.js +2 -2
- package/components/page/layouts/website-section.marko.js +2 -2
- package/components/page/metadata/components/common.marko.js +2 -2
- package/components/page/metadata/content.marko.js +2 -2
- package/components/page/metadata/default.marko.js +2 -2
- package/components/page/metadata/dynamic-page.marko.js +2 -2
- package/components/page/metadata/magazine-issue.marko.js +2 -2
- package/components/page/metadata/magazine-publication.marko.js +2 -2
- package/components/page/metadata/website-section.marko.js +2 -2
- package/components/page/rel-canonical.marko.js +2 -2
- package/components/page/title.marko.js +2 -2
- package/components/page/wrapper.marko.js +2 -2
- package/components/resolve/page.marko.js +2 -2
- package/components/rss/website-section.marko.js +2 -2
- package/integration/test-website-boot.js +51 -37
- package/package.json +2 -2
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/layouts/magazine-publication.marko",
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
7
7
|
marko_web_magazine_publication_page_metadata_template = require("../metadata/magazine-publication.marko"),
|
8
8
|
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
@@ -52,7 +52,7 @@ marko_template._ = marko_renderer(render, {
|
|
52
52
|
});
|
53
53
|
|
54
54
|
marko_template.meta = {
|
55
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
55
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/layouts/magazine-publication.marko",
|
56
56
|
tags: [
|
57
57
|
"../metadata/magazine-publication.marko"
|
58
58
|
]
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/layouts/website-section.marko",
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
7
7
|
module_baseCmsObjectPath_module = require("@parameter1/base-cms-object-path"),
|
8
8
|
baseCmsObjectPath_module = module_baseCmsObjectPath_module.default || module_baseCmsObjectPath_module,
|
@@ -70,7 +70,7 @@ marko_template._ = marko_renderer(render, {
|
|
70
70
|
});
|
71
71
|
|
72
72
|
marko_template.meta = {
|
73
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
73
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/layouts/website-section.marko",
|
74
74
|
tags: [
|
75
75
|
"../metadata/website-section.marko",
|
76
76
|
"../../rss/website-section.marko"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/components/common.marko",
|
6
6
|
marko_component = require("./common.marko"),
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
8
8
|
marko_web_page_title_template = require("../../title.marko"),
|
@@ -98,7 +98,7 @@ marko_template._ = marko_renderer(render, {
|
|
98
98
|
}, marko_component);
|
99
99
|
|
100
100
|
marko_template.meta = {
|
101
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
101
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/components/common.marko",
|
102
102
|
component: "./common.marko",
|
103
103
|
tags: [
|
104
104
|
"../../title.marko",
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/content.marko",
|
6
6
|
marko_component = require("./content.marko"),
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
8
8
|
module_gql = require("graphql-tag"),
|
@@ -197,7 +197,7 @@ marko_template._ = marko_renderer(render, {
|
|
197
197
|
}, marko_component);
|
198
198
|
|
199
199
|
marko_template.meta = {
|
200
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
200
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/content.marko",
|
201
201
|
component: "./content.marko",
|
202
202
|
tags: [
|
203
203
|
"./components/common.marko",
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/default.marko",
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
7
7
|
common_template = require("./components/common.marko"),
|
8
8
|
marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
|
@@ -22,7 +22,7 @@ marko_template._ = marko_renderer(render, {
|
|
22
22
|
});
|
23
23
|
|
24
24
|
marko_template.meta = {
|
25
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
25
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/default.marko",
|
26
26
|
tags: [
|
27
27
|
"./components/common.marko"
|
28
28
|
]
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/dynamic-page.marko",
|
6
6
|
marko_component = require("./dynamic-page.marko"),
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
8
8
|
module_gql = require("graphql-tag"),
|
@@ -75,7 +75,7 @@ marko_template._ = marko_renderer(render, {
|
|
75
75
|
}, marko_component);
|
76
76
|
|
77
77
|
marko_template.meta = {
|
78
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
78
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/dynamic-page.marko",
|
79
79
|
component: "./dynamic-page.marko",
|
80
80
|
tags: [
|
81
81
|
"./components/common.marko",
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/magazine-issue.marko",
|
6
6
|
marko_component = require("./magazine-issue.marko"),
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
8
8
|
module_gql = require("graphql-tag"),
|
@@ -74,7 +74,7 @@ marko_template._ = marko_renderer(render, {
|
|
74
74
|
}, marko_component);
|
75
75
|
|
76
76
|
marko_template.meta = {
|
77
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
77
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/magazine-issue.marko",
|
78
78
|
component: "./magazine-issue.marko",
|
79
79
|
tags: [
|
80
80
|
"./components/common.marko",
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/magazine-publication.marko",
|
6
6
|
marko_component = require("./magazine-publication.marko"),
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
8
8
|
module_gql = require("graphql-tag"),
|
@@ -70,7 +70,7 @@ marko_template._ = marko_renderer(render, {
|
|
70
70
|
}, marko_component);
|
71
71
|
|
72
72
|
marko_template.meta = {
|
73
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
73
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/magazine-publication.marko",
|
74
74
|
component: "./magazine-publication.marko",
|
75
75
|
tags: [
|
76
76
|
"./components/common.marko",
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/website-section.marko",
|
6
6
|
marko_component = require("./website-section.marko"),
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
8
8
|
module_gql = require("graphql-tag"),
|
@@ -70,7 +70,7 @@ marko_template._ = marko_renderer(render, {
|
|
70
70
|
}, marko_component);
|
71
71
|
|
72
72
|
marko_template.meta = {
|
73
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
73
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/metadata/website-section.marko",
|
74
74
|
component: "./website-section.marko",
|
75
75
|
tags: [
|
76
76
|
"./components/common.marko",
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/rel-canonical.marko",
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
7
7
|
module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
|
8
8
|
baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
|
@@ -38,5 +38,5 @@ marko_template._ = marko_renderer(render, {
|
|
38
38
|
});
|
39
39
|
|
40
40
|
marko_template.meta = {
|
41
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
41
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/rel-canonical.marko"
|
42
42
|
};
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/title.marko",
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
7
7
|
module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
|
8
8
|
baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
|
@@ -42,5 +42,5 @@ marko_template._ = marko_renderer(render, {
|
|
42
42
|
});
|
43
43
|
|
44
44
|
marko_template.meta = {
|
45
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
45
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/title.marko"
|
46
46
|
};
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/page/wrapper.marko",
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
7
7
|
module_baseCmsObjectPath_module = require("@parameter1/base-cms-object-path"),
|
8
8
|
baseCmsObjectPath_module = module_baseCmsObjectPath_module.default || module_baseCmsObjectPath_module,
|
@@ -56,7 +56,7 @@ marko_template._ = marko_renderer(render, {
|
|
56
56
|
});
|
57
57
|
|
58
58
|
marko_template.meta = {
|
59
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
59
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/page/wrapper.marko",
|
60
60
|
tags: [
|
61
61
|
"../element/index.marko"
|
62
62
|
]
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/resolve/page.marko",
|
6
6
|
marko_component = require("./page.marko"),
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
8
8
|
module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
|
@@ -41,7 +41,7 @@ marko_template._ = marko_renderer(render, {
|
|
41
41
|
}, marko_component);
|
42
42
|
|
43
43
|
marko_template.meta = {
|
44
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
44
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/resolve/page.marko",
|
45
45
|
component: "./page.marko",
|
46
46
|
tags: [
|
47
47
|
"@parameter1/base-cms-marko-core/components/resolve.marko"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"use strict";
|
3
3
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
5
|
-
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.
|
5
|
+
marko_componentType = "/@parameter1/base-cms-marko-web$4.5.5/components/rss/website-section.marko",
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
7
7
|
module_url_module = require("url"),
|
8
8
|
url_module = module_url_module.default || module_url_module,
|
@@ -42,5 +42,5 @@ marko_template._ = marko_renderer(render, {
|
|
42
42
|
});
|
43
43
|
|
44
44
|
marko_template.meta = {
|
45
|
-
id: "/@parameter1/base-cms-marko-web$4.5.
|
45
|
+
id: "/@parameter1/base-cms-marko-web$4.5.5/components/rss/website-section.marko"
|
46
46
|
};
|
@@ -4,6 +4,7 @@ const whilst = require('async/whilst');
|
|
4
4
|
const eachLimit = require('async/eachLimit');
|
5
5
|
const fetch = require('node-fetch');
|
6
6
|
const cheerio = require('cheerio');
|
7
|
+
const { inspect } = require('util');
|
7
8
|
|
8
9
|
const { log } = console;
|
9
10
|
|
@@ -12,26 +13,18 @@ const origin = process.env.MARKO_WEB_INTEGRATION_TEST_URL || 'http://localhost:8
|
|
12
13
|
const fetchResponse = async ({
|
13
14
|
path = '/',
|
14
15
|
catchErrors = false,
|
15
|
-
returnNullWhenNotOk = false,
|
16
16
|
} = {}) => {
|
17
17
|
const url = `${cleanPath(origin)}/${cleanPath(path)}`;
|
18
18
|
log(`fetching ${url}`);
|
19
|
-
const opts = { method: 'get' };
|
19
|
+
const opts = { method: 'get', redirect: 'manual' };
|
20
20
|
if (!catchErrors) return fetch(url, opts);
|
21
21
|
try {
|
22
|
-
|
23
|
-
if (returnNullWhenNotOk && !res.ok) return null;
|
24
|
-
return res;
|
22
|
+
return fetch(url, opts);
|
25
23
|
} catch (e) {
|
26
24
|
return null;
|
27
25
|
}
|
28
26
|
};
|
29
27
|
|
30
|
-
const retryableMarkoErrors = new Set([
|
31
|
-
'Network error: Unexpected token < in JSON at position 0',
|
32
|
-
'Timed out after 10000ms',
|
33
|
-
]);
|
34
|
-
|
35
28
|
const checkReadiness = async ({
|
36
29
|
path = '/_health',
|
37
30
|
startAfter = 5000,
|
@@ -65,65 +58,75 @@ const checkReadiness = async ({
|
|
65
58
|
};
|
66
59
|
|
67
60
|
const testPage = async ({ path, retryAttempts = 3, serverErrorsOnly = true } = {}) => {
|
68
|
-
log(`testing page path ${path}`);
|
69
|
-
|
70
61
|
let timesChecked = 0;
|
71
|
-
let
|
62
|
+
let finished = false;
|
72
63
|
let html;
|
73
|
-
|
64
|
+
const report = {
|
65
|
+
path,
|
66
|
+
error: null,
|
67
|
+
checks: [],
|
68
|
+
};
|
69
|
+
await whilst(async () => !finished, async () => {
|
70
|
+
const check = {};
|
71
|
+
report.checks.push(check);
|
74
72
|
timesChecked += 1;
|
75
73
|
if (timesChecked > retryAttempts) {
|
76
|
-
|
74
|
+
// max times reach, append error to report.
|
75
|
+
report.error = new Error(`The test runner for page path ${path} has reached its maximum check limit.`);
|
76
|
+
finished = true;
|
77
|
+
return;
|
77
78
|
}
|
78
79
|
const res = await fetchResponse({ path });
|
80
|
+
check.statusCode = res.status;
|
79
81
|
if (!res.ok) {
|
80
82
|
if (serverErrorsOnly && res.status < 500) {
|
81
|
-
|
82
|
-
|
83
|
+
check.message = `received a ${res.status} from path ${path} but treating as passing since it was not a server error (>= 500).`;
|
84
|
+
finished = true;
|
83
85
|
return;
|
84
86
|
}
|
85
|
-
|
87
|
+
// received a 500, append the message and retry
|
88
|
+
check.message = `received an error response from path page ${path} with status ${res.status} ${res.statusText}`;
|
89
|
+
return;
|
86
90
|
}
|
87
91
|
html = await res.text();
|
88
92
|
|
89
93
|
// first ensure the entire page rendered. if it didn't a fatal backened error occurred
|
90
94
|
// that prevented rendering, or some kind of timeout occurred. this can be retried.
|
91
95
|
const found = /.*<\/head>.*<\/body>.*<\/html>.*/is.test(html);
|
92
|
-
if (!found)
|
96
|
+
if (!found) {
|
97
|
+
// no render, append the message and retry.
|
98
|
+
check.message = `unable to detect a full page render for path ${path} retrying...`;
|
99
|
+
return;
|
100
|
+
}
|
93
101
|
|
94
102
|
// then check for in-body errors. this means an async internal block failed
|
95
103
|
// but the page could fully render.
|
96
104
|
const matches = [...html.matchAll(/data-marko-error="(.*?)"/g)];
|
97
|
-
|
105
|
+
check.inPageErrors = [];
|
98
106
|
matches.forEach((values) => {
|
99
107
|
const value = values[1];
|
100
|
-
|
108
|
+
check.inPageErrors.push(htmlEntities.decode(value));
|
101
109
|
});
|
102
|
-
if (
|
103
|
-
//
|
104
|
-
|
105
|
-
log(`all errors for page path ${path} were flagged as retryable. retrying...`);
|
106
|
-
return; // exit out so it can be retried.
|
107
|
-
}
|
108
|
-
// otherwise error.
|
109
|
-
log({ path, errors });
|
110
|
-
throw new Error(`Encountered server-side Marko error(s) at page path ${path}`);
|
110
|
+
if (check.inPageErrors.length) {
|
111
|
+
// in-page errors occurred. exit and retry
|
112
|
+
return;
|
111
113
|
}
|
112
|
-
|
114
|
+
// otherwise, mark as finished.
|
115
|
+
finished = true;
|
113
116
|
});
|
114
|
-
|
115
|
-
return html;
|
117
|
+
return { html, report };
|
116
118
|
};
|
117
119
|
|
118
120
|
const run = async () => {
|
119
121
|
await checkReadiness();
|
120
122
|
|
121
123
|
// test homepage first, and get html.
|
122
|
-
const html = await testPage({ path: '/', serverErrorsOnly: false });
|
124
|
+
const { html, report: initialReport } = await testPage({ path: '/', serverErrorsOnly: false });
|
123
125
|
|
124
126
|
const toTest = new Map([
|
125
127
|
['/search', {}],
|
126
128
|
['/site-map', {}],
|
129
|
+
['/15307352', {}],
|
127
130
|
]);
|
128
131
|
const contentToTest = new Map();
|
129
132
|
|
@@ -146,22 +149,33 @@ const run = async () => {
|
|
146
149
|
|
147
150
|
// now test all extracted pages.
|
148
151
|
const errors = [];
|
152
|
+
const reports = [initialReport];
|
149
153
|
await eachLimit([...toTest, ...contentToTest], 2, async ([path, opts]) => {
|
150
154
|
// catch all errors so they can be reported on at once.
|
155
|
+
// these should be internal at this point.
|
151
156
|
try {
|
152
|
-
await testPage({ ...opts, path });
|
157
|
+
const { report } = await testPage({ ...opts, path });
|
158
|
+
reports.push(report);
|
153
159
|
} catch (e) {
|
154
160
|
errors.push(e);
|
155
161
|
}
|
156
162
|
});
|
157
163
|
|
158
164
|
if (errors.length) {
|
159
|
-
log('
|
165
|
+
log('INTERNAL TESTING ERRORS ENCOUNTERED');
|
160
166
|
errors.forEach((error) => {
|
161
167
|
log(error);
|
162
168
|
});
|
163
|
-
throw new Error('
|
169
|
+
throw new Error('Internal testing errors were encountered.');
|
170
|
+
}
|
171
|
+
|
172
|
+
const errorReports = reports.filter((report) => report.error);
|
173
|
+
if (errorReports.length) {
|
174
|
+
log('PAGE ERRORS ENCOUNTERED');
|
175
|
+
errorReports.forEach((report) => log(report));
|
176
|
+
throw new Error('Page errors were encountered.');
|
164
177
|
}
|
178
|
+
log('test results', inspect(reports, { colors: true, depth: null }));
|
165
179
|
};
|
166
180
|
|
167
181
|
run().catch((e) => setImmediate(() => { throw e; }));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@parameter1/base-cms-marko-web",
|
3
|
-
"version": "4.5.
|
3
|
+
"version": "4.5.5",
|
4
4
|
"description": "Core Marko+Express components for BaseCMS websites",
|
5
5
|
"author": "Jacob Bare <jacob@parameter1.com>",
|
6
6
|
"main": "index.js",
|
@@ -59,5 +59,5 @@
|
|
59
59
|
"publishConfig": {
|
60
60
|
"access": "public"
|
61
61
|
},
|
62
|
-
"gitHead": "
|
62
|
+
"gitHead": "1ad9fc4905a5b08abe2ba99c95bc60b0fa1d2742"
|
63
63
|
}
|