minor: Suggest with_field instead of override for non-functions.

This commit is contained in:
Abhijeet Prasad Bodas
2021-02-13 17:50:29 +05:30
committed by Steve Howell
parent a24d8272e8
commit c183076a91

View File

@@ -106,7 +106,9 @@ exports.with_overrides = function (test_function) {
// step. Generally our code calls `run_test`, which wraps
// `with_overrides`.
if (typeof f !== "function") {
throw new TypeError("You can only override with a function.");
throw new TypeError(
"You can only override with a function. Use with_field for non-functions.",
);
}
if (!funcs.has(obj)) {