Skip to content

Commit

Permalink
test: $to under $denyallow
Browse files Browse the repository at this point in the history
  • Loading branch information
seia-soto committed Dec 12, 2024
1 parent a69b5ea commit f106227
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/adblocker/test/parsing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,25 @@ describe('Network filters', () => {
denyallow: undefined,
});
});

context('to', () => {
it('fails when both denyallow and to used', () => {
network('||foo.com$denyallow=foo.com,to=bar.com', null);
network('||foo.com$to=foo.com,denyallow=bar.com', null);
});

it('reverses domains condition', () => {
network('||foo.com$to=bar.com|baz.com', {
denyallow: {
hostnames: undefined,
entities: undefined,
notHostnames: h(['bar.com', 'baz.com']),
notEntities: undefined,
parts: undefined,
},
});
});
});
});

describe('redirect', () => {
Expand Down

0 comments on commit f106227

Please sign in to comment.