mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
node tests: Clean up robust_uri_decode.
This commit is contained in:
committed by
Steve Howell
parent
3e552268e5
commit
f5488b98eb
@@ -110,14 +110,23 @@ run_test("robust_uri_decode", () => {
|
||||
assert.equal(util.robust_uri_decode("xxx%3Ayyy"), "xxx:yyy");
|
||||
assert.equal(util.robust_uri_decode("xxx%3"), "xxx");
|
||||
|
||||
set_global("decodeURIComponent", () => {
|
||||
throw new Error("foo");
|
||||
});
|
||||
try {
|
||||
util.robust_uri_decode("%E0%A4%A");
|
||||
} catch (error) {
|
||||
assert.equal(error.message, "foo");
|
||||
}
|
||||
let error_message;
|
||||
with_field(
|
||||
global,
|
||||
"decodeURIComponent",
|
||||
() => {
|
||||
throw new Error("foo");
|
||||
},
|
||||
() => {
|
||||
try {
|
||||
util.robust_uri_decode("%E0%A4%A");
|
||||
} catch (error) {
|
||||
error_message = error.message;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
assert.equal(error_message, "foo");
|
||||
});
|
||||
|
||||
run_test("dumb_strcmp", () => {
|
||||
|
Reference in New Issue
Block a user