Skip to content

Commit fc5718e

Browse files
committed
fix tests
1 parent 0e398b5 commit fc5718e

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

test/builder.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ describe('Invalid rules collection in report', () => {
15071507
// Check that the invalid rule from conversion error is in the report
15081508
expect(reportContent).toContain('INVALID RULES:');
15091509
expect(reportContent).toContain('jpopsingles.eu$$script:contains(eval(function(p,a,c,k,e,d))');
1510-
expect(reportContent).toContain('Unable to convert rule to AdGuard syntax');
1510+
expect(reportContent).toContain('Error: Unable to convert rule to AdGuard syntax');
15111511
expect(reportContent).not.toContain('||filter14.example.com^');
15121512
});
15131513

@@ -1518,7 +1518,7 @@ describe('Invalid rules collection in report', () => {
15181518
expect(diffContent.length).toBeGreaterThan(0);
15191519

15201520
const diffLines = diffContent.split('\n');
1521-
expect(diffLines[0]).toContain('Unable to convert rule to AdGuard syntax');
1521+
expect(diffLines[0]).toContain('Error: Unable to convert rule to AdGuard syntax');
15221522
expect(diffLines[1]).toContain('jpopsingles.eu$$script:contains(eval(function(p,a,c,k,e,d))');
15231523
});
15241524
});

test/converter.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ describe('converter', () => {
626626
expect(excluded).toHaveLength(2);
627627
expect(excluded).toEqual(
628628
[
629-
"! Unable to convert rule to AdGuard syntax: \"example.org#$#selector:style()\" due to error: 'AdblockPlus' syntax cannot be mixed with 'UblockOrigin' syntax",
629+
"! Error: Unable to convert rule to AdGuard syntax: \"example.org#$#selector:style()\" due to error: 'AdblockPlus' syntax cannot be mixed with 'UblockOrigin' syntax",
630630
'example.org#$#selector:style()',
631631
],
632632
);
@@ -638,7 +638,7 @@ describe('converter', () => {
638638
expect(excluded).toHaveLength(2);
639639
expect(excluded).toEqual(
640640
[
641-
"! Unable to convert rule to AdGuard syntax: \"yamareco.com#$#body.header_bg_ad.modal-open:style(padding-right: auto !important;overflow: auto!important)\" due to error: 'AdblockPlus' syntax cannot be mixed with 'UblockOrigin' syntax",
641+
"! Error: Unable to convert rule to AdGuard syntax: \"yamareco.com#$#body.header_bg_ad.modal-open:style(padding-right: auto !important;overflow: auto!important)\" due to error: 'AdblockPlus' syntax cannot be mixed with 'UblockOrigin' syntax",
642642
'yamareco.com#$#body.header_bg_ad.modal-open:style(padding-right: auto !important;overflow: auto!important)',
643643
],
644644
);

test/resources/filters/filter_2_English/diff.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! Unable to convert rule to AdGuard syntax: "||test-common-rule.com^$replace=" due to error: Modifier value cannot be empty
1+
! Error: Unable to convert rule to AdGuard syntax: "||test-common-rule.com^$replace=" due to error: Modifier value cannot be empty
22
||test-common-rule.com^$replace=
33
! Rule "example.com##h1:style(background-color: blue !important)" converted to: "example.com#$#h1 { background-color: blue !important }"
44
example.com##h1:style(background-color: blue !important)
@@ -8,9 +8,9 @@ test-common-1-rule.com$xmlhttprequest
88
regularexpressionexcluded
99
! ###adsbox is excluded by "/^##.adsbox$/" in exclude_1.txt
1010
###adsbox
11-
! Unable to convert rule to AdGuard syntax: "||test-common-1-rule.com^$replace=" due to error: Modifier value cannot be empty
11+
! Error: Unable to convert rule to AdGuard syntax: "||test-common-1-rule.com^$replace=" due to error: Modifier value cannot be empty
1212
||test-common-1-rule.com^$replace=
13-
! Unable to convert rule to AdGuard syntax: "||test.com^$replace=" due to error: Modifier value cannot be empty
13+
! Error: Unable to convert rule to AdGuard syntax: "||test.com^$replace=" due to error: Modifier value cannot be empty
1414
||test.com^$replace=
1515
! ||test.com^$third-party is excluded by "||test.com^$third-party" in exclude.txt
1616
||test.com^$third-party
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! Unable to convert rule to AdGuard syntax: "||test-common-rule.com^$replace=" due to error: Modifier value cannot be empty
1+
! Error: Unable to convert rule to AdGuard syntax: "||test-common-rule.com^$replace=" due to error: Modifier value cannot be empty
22
||test-common-rule.com^$replace=
33
! Rule "example.com##h1:style(background-color: blue !important)" converted to: "example.com#$#h1 { background-color: blue !important }"
44
example.com##h1:style(background-color: blue !important)

test/resources/filters/filter_5_TrustLevel/diff.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ example.com##^script:contains(banner)
1212
||www.ynet.co.il^$important,websocket,1p,domain=www.ynet.co.il
1313
! Rule "@@.com/ads.js|$3p,domain=~3ppt.com']" converted to: "@@.com/ads.js|$third-party,domain=~3ppt.com']"
1414
@@.com/ads.js|$3p,domain=~3ppt.com']
15-
! Unable to convert rule to AdGuard syntax: "example.com##^script:has-text(/.advert/)" due to error: Cannot convert RegExp parameter '/.advert/' from 'has-text' pseudo class, because converting RegExp patterns are not supported yet
15+
! Error: Unable to convert rule to AdGuard syntax: "example.com##^script:has-text(/.advert/)" due to error: Cannot convert RegExp parameter '/.advert/' from 'has-text' pseudo class, because converting RegExp patterns are not supported yet
1616
example.com##^script:has-text(/.advert/)
17-
! Unable to convert rule to AdGuard syntax: "rybnik.com.pl##^iframe[name]:not([class]):not([id]):not([src])[style="display:none"]" due to error: Unsupported pseudo class 'not'
17+
! Error: Unable to convert rule to AdGuard syntax: "rybnik.com.pl##^iframe[name]:not([class]):not([id]):not([src])[style="display:none"]" due to error: Unsupported pseudo class 'not'
1818
rybnik.com.pl##^iframe[name]:not([class]):not([id]):not([src])[style="display:none"]
1919
! Rule "test.com#$#abort-on-property-read adsShown" converted to: "test.com#%#//scriptlet('abp-abort-on-property-read', 'adsShown')"
2020
test.com#$#abort-on-property-read adsShown

0 commit comments

Comments
 (0)