node tests: Add coverage for python_to_js_filter.

This commit is contained in:
Yago González 2017-06-13 23:26:27 +02:00 committed by showell
parent 97a07f311e
commit 44078a73bf
1 changed files with 9 additions and 0 deletions

View File

@ -321,3 +321,12 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
assert.equal(message.flags.length, 0);
assert(message.flags.indexOf('mentioned') === -1);
}());
(function test_python_to_js_filter() {
// The only way to reach python_to_js_filter is indirectly, hence the call
// to set_realm_filters.
markdown.set_realm_filters([[ '/a(?im)a/g'], [ '/a(?L)a/g' ]]);
var actual_value = (marked.InlineLexer.rules.zulip.realm_filters);
var expected_value = [ /\/aa\/g/gim, /\/aa\/g/g ];
assert.deepEqual(actual_value, expected_value);
}());