Index: test/snippets.js |
=================================================================== |
--- a/test/snippets.js |
+++ b/test/snippets.js |
@@ -43,17 +43,17 @@ |
function testScriptMatches(description, filters, domain, expectedMatches) |
{ |
for (let filter of filters.map(Filter.fromText)) |
{ |
if (filter instanceof SnippetFilter) |
Snippets.add(filter); |
} |
- let matches = Snippets.getScriptsForDomain(domain); |
+ let matches = Snippets.getFiltersForDomain(domain).map(elem => elem.script); |
Manish Jethani
2018/08/27 12:36:21
Nit: Can we keep it `filter => filter.script` simi
hub
2018/08/27 12:53:35
Done.
|
test.deepEqual(matches.sort(), expectedMatches.sort(), description); |
Snippets.clear(); |
} |
testScriptMatches( |
"Ignore generic filters", |
[ |
@@ -83,18 +83,17 @@ |
test.done(); |
}; |
exports.testSnippetFiltersContainer = function(test) |
{ |
function compareRules(description, domain, expectedMatches) |
{ |
- let result = Snippets.getScriptsForDomain(domain); |
- expectedMatches = expectedMatches.map(filter => filter.script); |
+ let result = Snippets.getFiltersForDomain(domain); |
test.deepEqual(result.sort(), expectedMatches.sort(), description); |
} |
let domainFilter = Filter.fromText("example.com#$#filter1"); |
let subdomainFilter = Filter.fromText("www.example.com#$#filter2"); |
let otherDomainFilter = Filter.fromText("other.example.com#$#filter3"); |
Snippets.add(domainFilter); |