From ee52618e1b379f54de73155f2d46de21fa4ee1ce Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 8 Nov 2024 01:30:02 -0800 Subject: [PATCH] namespace: Require rewired variables to be exported. Signed-off-by: Anders Kaseorg --- web/tests/lib/namespace.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/tests/lib/namespace.js b/web/tests/lib/namespace.js index 017ad96161..0a81332c25 100644 --- a/web/tests/lib/namespace.js +++ b/web/tests/lib/namespace.js @@ -356,8 +356,8 @@ exports.with_overrides = function (test_function) { `We cannot override a function for ${typeof obj} objects`, ); - // https://github.com/rosswarren/babel-plugin-rewire-ts/issues/15 - const old_value = prop in obj ? obj[prop] : obj.__GetDependency__(prop); + assert.ok(Object.hasOwn(obj, prop)); + const old_value = obj[prop]; let new_value = value; if (typeof value === "function") {