Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

node_tests: Fix incorrect usage of assert.throws.

Anders Kaseorg2bfe8d5c9076
diff --git a/frontend_tests/node_tests/fold_dict.js b/frontend_tests/node_tests/fold_dict.js
index dd16b611f6c..8e2ec4528a6 100644
--- a/frontend_tests/node_tests/fold_dict.js
+++ b/frontend_tests/node_tests/fold_dict.js
@@ -94,9 +94,8 @@ run_test("clear", () => {
run_test("undefined_keys", () => {
const d = new FoldDict();
- assert.throws(
- () => d.has(undefined),
- TypeError,
- "Tried to call a FoldDict method with an undefined key.",
- );
+ assert.throws(() => d.has(undefined), {
+ name: "TypeError",
+ message: "Tried to call a FoldDict method with an undefined key.",
+ });
});
diff --git a/frontend_tests/node_tests/settings_config.js b/frontend_tests/node_tests/settings_config.js
index 19bd9318654..c40abb527be 100644
--- a/frontend_tests/node_tests/settings_config.js
+++ b/frontend_tests/node_tests/settings_config.js
@@ -22,7 +22,10 @@ run_test("all_notifications", () => {
// is passed. In this case, we articulate that with
// wildcard_mentions_notify being undefined, which will be
// the case, if a wrong setting_name is passed.
- assert.throws(settings_config.all_notifications, "Incorrect setting_name passed");
+ assert.throws(settings_config.all_notifications, {
+ name: "TypeError",
+ message: "Incorrect setting_name passed: wildcard_mentions_notify",
+ });
user_settings.wildcard_mentions_notify = false;
const notifications = settings_config.all_notifications();