mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
node test runner: Prevent Handlebars quirks.
We re-require templates.ts before testing each new test module during the node tests. This makes it so that if we make mocks in two different tests, where such mocks influence how the Handlebars helpers work, then both tests will have registered their own copies of the Handlebars helpers.
This commit is contained in:
@@ -20,10 +20,6 @@ page_params.translation_data = {
|
||||
"<p>Le canal <b>{name}</b> n'existe pas.</p><p>Gérez vos abonnements <z-link>sur votre page canaux</z-link>.</p>",
|
||||
};
|
||||
|
||||
// Re-register Zulip extensions so extensions registered previously with
|
||||
// mocked i18n.ts do not interfere with following tests.
|
||||
require("../src/templates.ts");
|
||||
|
||||
// All of our other tests stub out i18n activity;
|
||||
// here we do a quick sanity check on the engine itself.
|
||||
// `i18n.ts` initializes FormatJS and is imported by
|
||||
|
@@ -128,6 +128,9 @@ test.set_verbose(files.length === 1);
|
||||
namespace.mock_esm("../../src/page_params", zpage_params);
|
||||
require("../../src/page_params.ts");
|
||||
|
||||
// Make sure we re-register our Handlebars helpers.
|
||||
require("../../src/templates.ts");
|
||||
|
||||
try {
|
||||
await run_one_module(file);
|
||||
blueslip.reset();
|
||||
|
Reference in New Issue
Block a user