OLD | NEW |
1 "use strict"; | 1 "use strict"; |
2 | 2 |
3 (function() | |
4 { | 3 { |
5 const {parseFilter, parseFilters} = require("filterValidation"); | 4 const {parseFilter, parseFilters} = require("filterValidation"); |
6 const {BlockingFilter, | 5 const {BlockingFilter, |
7 ElemHideFilter, | 6 ElemHideFilter, |
8 CommentFilter} = require("filterClasses"); | 7 CommentFilter} = require("filterClasses"); |
9 | 8 |
10 module("Filter validation"); | 9 module("Filter validation"); |
11 | 10 |
12 test("Detecting invalid filters", () => | 11 test("Detecting invalid filters", () => |
13 { | 12 { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 63 |
65 ok(result.filters[0] instanceof BlockingFilter, "1st filter is blocking"); | 64 ok(result.filters[0] instanceof BlockingFilter, "1st filter is blocking"); |
66 equal(result.filters[0].text, "||example.com^", "1st filter text matches"); | 65 equal(result.filters[0].text, "||example.com^", "1st filter text matches"); |
67 | 66 |
68 ok(result.filters[1] instanceof ElemHideFilter, "2nd filter is elemhide"); | 67 ok(result.filters[1] instanceof ElemHideFilter, "2nd filter is elemhide"); |
69 equal(result.filters[1].text, "###foobar", "2nd filter text matches"); | 68 equal(result.filters[1].text, "###foobar", "2nd filter text matches"); |
70 | 69 |
71 ok(result.filters[2] instanceof CommentFilter, "3rd filter is comment"); | 70 ok(result.filters[2] instanceof CommentFilter, "3rd filter is comment"); |
72 equal(result.filters[2].text, "! foo bar", "3rd filter text matches"); | 71 equal(result.filters[2].text, "! foo bar", "3rd filter text matches"); |
73 }); | 72 }); |
74 }()); | 73 } |
OLD | NEW |