js: Convert static/js/page_params.js to ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-03-25 14:35:45 -07:00
committed by Tim Abbott
parent bb1b2048bd
commit 38ffd47b90
158 changed files with 297 additions and 270 deletions

View File

@@ -116,12 +116,12 @@ like the following toward the top of your test file:
For modules that you want to completely stub out, use a pattern like
this:
> set_global('page_params', {
> email: 'bob@zulip.com'
> const reminder = mock_esm("../../static/js/reminder", {
> is_deferred_delivery: noop,
> });
>
> // then maybe further down
> page_params.email = 'alice@zulip.com';
> reminder.is_deferred_delivery = () => true;
One can similarly stub out functions in a module's exported interface
with either `noop` functions or actual code.