mirror of
https://github.com/zulip/zulip.git
synced 2025-10-31 20:13:46 +00:00
node_tests: Convert rewiremock.proxy uses to low level API.
This seems easier to understand and much easier to produce automatically. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
aee94f141d
commit
48c67700ed
@@ -38,9 +38,11 @@ page_params.custom_profile_field_types = {
|
||||
},
|
||||
};
|
||||
|
||||
const settings_profile_fields = rewiremock.proxy(() => zrequire("settings_profile_fields"), {
|
||||
sortablejs: {default: {create: () => {}}},
|
||||
});
|
||||
rewiremock("sortablejs").with({default: {create: () => {}}});
|
||||
|
||||
rewiremock.enable();
|
||||
|
||||
const settings_profile_fields = zrequire("settings_profile_fields");
|
||||
|
||||
function test_populate(opts) {
|
||||
const fields_data = opts.fields_data;
|
||||
@@ -186,3 +188,5 @@ run_test("populate_profile_fields", () => {
|
||||
is_admin: true,
|
||||
});
|
||||
});
|
||||
|
||||
rewiremock.disable();
|
||||
|
||||
Reference in New Issue
Block a user