From d16a730d8124c7922b74b2ff5782c20011b06ee8 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 12 Feb 2020 02:27:02 -0800 Subject: [PATCH] zjquery: Mock text more accurately. Signed-off-by: Anders Kaseorg --- frontend_tests/zjsunit/zjquery.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend_tests/zjsunit/zjquery.js b/frontend_tests/zjsunit/zjquery.js index 7878ba34c8..ae0b52de60 100644 --- a/frontend_tests/zjsunit/zjquery.js +++ b/frontend_tests/zjsunit/zjquery.js @@ -329,9 +329,11 @@ exports.make_new_elem = function (selector, opts) { stop: function () { return self; }, - text: function (arg) { - if (arg !== undefined) { - text = arg; + text: function (...args) { + if (args.length !== 0) { + if (args[0] !== undefined) { + text = args[0].toString(); + } return self; } return text;