Skip to content

Commit 42d429b

Browse files
author
Guy Bedford
authored
fix: Backend.prototype.health method definition (#1143)
1 parent 74e1602 commit 42d429b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

integration-tests/js-compute/fixtures/module-mode/src/dynamic-backend.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,6 +2459,7 @@ routes.set('/backend/timeout', async () => {
24592459
strictEqual(backend.name, 'fastly');
24602460
strictEqual(backend.toString(), 'fastly');
24612461
strictEqual(backend.toName(), 'fastly');
2462+
strictEqual(backend.health(), 'unknown');
24622463
strictEqual(backend.target, 'www.fastly.com', 'target');
24632464
strictEqual(backend.hostOverride, 'www.fastly.com', 'override');
24642465
strictEqual(backend.port, 443, 'port');
@@ -2496,6 +2497,7 @@ routes.set('/backend/timeout', async () => {
24962497
strictEqual(backend.name, 'http-me');
24972498
strictEqual(backend.toString(), 'http-me');
24982499
strictEqual(backend.toName(), 'http-me');
2500+
strictEqual(backend.health(), 'unknown');
24992501
strictEqual(backend.target, 'http-me.glitch.me', 'target');
25002502
strictEqual(backend.hostOverride, 'http-me.glitch.me', 'hostOverride');
25012503
strictEqual(backend.port, 443, 'port');

integration-tests/js-compute/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ await Promise.all([
192192
// and we don't currently have a reliable way to poll on that
193193
// (perhaps we could poll on the highest version as seen from setup.js resource-link return output
194194
// being fully activated?)
195-
new Promise((resolve) => setTimeout(resolve, 60_000)),
195+
local ? null : new Promise((resolve) => setTimeout(resolve, 60_000)),
196196
]);
197197

198198
core.endGroup();

runtime/fastly/builtins/backend.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,9 +1646,9 @@ const JSFunctionSpec Backend::static_methods[] = {
16461646
JS_FN("exists", exists, 1, JSPROP_ENUMERATE), JS_FN("fromName", from_name, 1, JSPROP_ENUMERATE),
16471647
JS_FN("health", health_for_name, 1, JSPROP_ENUMERATE), JS_FS_END};
16481648
const JSPropertySpec Backend::static_properties[] = {JS_PS_END};
1649-
const JSFunctionSpec Backend::methods[] = {JS_FN("toString", name_get, 0, JSPROP_ENUMERATE),
1650-
JS_FN("toName", name_get, 0, JSPROP_ENUMERATE),
1651-
JS_FS_END};
1649+
const JSFunctionSpec Backend::methods[] = {
1650+
JS_FN("health", health, 0, JSPROP_ENUMERATE), JS_FN("toString", name_get, 0, JSPROP_ENUMERATE),
1651+
JS_FN("toName", name_get, 0, JSPROP_ENUMERATE), JS_FS_END};
16521652
const JSPropertySpec Backend::properties[] = {
16531653
JS_PSG("name", name_get, JSPROP_ENUMERATE),
16541654
JS_PSG("isDynamic", is_dynamic_get, JSPROP_ENUMERATE),

0 commit comments

Comments
 (0)