mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
ES and TypeScript modules are strict by default and don’t need this directive. ESLint will remind us to add it to new CommonJS files and remove it from ES and TypeScript modules. Signed-off-by: Anders Kaseorg <anders@zulip.com>
25 lines
523 B
JavaScript
25 lines
523 B
JavaScript
"use strict";
|
|
|
|
const LazySet = zrequire("lazy_set").LazySet;
|
|
|
|
/*
|
|
We mostly test LazySet indirectly. This code
|
|
may be short-lived, anyway, once we change
|
|
how we download subscribers in page_params.
|
|
*/
|
|
|
|
run_test("map", () => {
|
|
const ls = new LazySet([1, 2]);
|
|
|
|
const triple = (n) => n * 3;
|
|
|
|
assert.deepEqual(ls.map(triple), [3, 6]);
|
|
});
|
|
|
|
run_test("conversions", () => {
|
|
blueslip.expect("error", "not a number", 2);
|
|
const ls = new LazySet([1, 2]);
|
|
ls.add("3");
|
|
assert(ls.has("3"));
|
|
});
|