mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
js: Convert static/js/page_params.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
bb1b2048bd
commit
38ffd47b90
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user