Skip to content

Commit e8baf71

Browse files
committed
format code, fix css rule
1 parent c9c3489 commit e8baf71

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

src/main/utils/log.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const logger = {
6969
*/
7070
error(message) {
7171
if (isLevelIncluded(Levels.ERROR)) {
72-
console.logger.log(message);
72+
console.log(message);
7373
appendFile(message, 'ERROR');
7474
}
7575
},

src/test/builder.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
* @vitest-environment jsdom
44
*/
55
import {
6-
describe, it, expect, beforeAll, test, vi,
6+
describe,
7+
it,
8+
expect,
9+
beforeAll,
10+
test,
11+
vi,
712
} from 'vitest';
813
import path from 'path';
914
import { promises as fs, existsSync } from 'fs';

src/test/converter.test.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
/* eslint-disable max-len */
22
import {
3-
describe, it, expect, vi,
3+
describe,
4+
it,
5+
expect,
6+
vi,
47
} from 'vitest';
58

69
import {
7-
convertAdgToUbo, convertAbpToAdg, convertScriptletToAdg,
10+
convertAdgToUbo,
11+
convertAbpToAdg,
12+
convertScriptletToAdg,
813
} from '@adguard/scriptlets/converters';
914

1015
import {
@@ -40,12 +45,11 @@ describe('converter', () => {
4045
expect(c[0]).toBe('benchmark.pl#$##bannerDBB { height: 10px !important; }');
4146

4247
// https://github.com/AdguardTeam/FiltersCompiler/issues/24
43-
// FIXME: uncomment and fix 2 following tests due to the issue mentioned above
44-
// c = convertRulesToAdgSyntax(['720hd.club#?##all:style(margin-top: 0 !important)']);
45-
// expect(c[0]).toBe('720hd.club#?$##all { margin-top: 0 !important }');
46-
//
47-
// c = convertRulesToAdgSyntax(['720hd.club#@?##all:style(margin-top: 0 !important)']);
48-
// expect(c[0]).toBe('720hd.club#@$?##all { margin-top: 0 !important }');
48+
c = convertRulesToAdgSyntax(['720hd.club#?##all:style(margin-top: 0 !important)']);
49+
expect(c[0]).toBe('720hd.club#$##all { margin-top: 0 !important }');
50+
51+
c = convertRulesToAdgSyntax(['720hd.club#@?##all:style(margin-top: 0 !important)']);
52+
expect(c[0]).toBe('720hd.club#@$##all { margin-top: 0 !important }');
4953

5054
// https://github.com/AdguardTeam/FiltersCompiler/issues/54
5155
c = convertRulesToAdgSyntax(['#####']);
@@ -279,13 +283,12 @@ describe('converter', () => {
279283
});
280284

281285
it('scriptlets converter is working', () => {
282-
// FIXME
283-
// let actual = convertAdgToUbo('example.com#@#+js(nano-setInterval-booster.js, some.example, 1000)');
284-
// let expected = "example.com#@%#//scriptlet('ubo-nano-setInterval-booster.js', 'some.example', '1000')";
285-
// expect(actual[0]).toBe(expected);
286+
let actual = convertScriptletToAdg('example.com#@#+js(nano-setInterval-booster.js, some.example, 1000)');
287+
let expected = "example.com#@%#//scriptlet('ubo-nano-setInterval-booster.js', 'some.example', '1000')";
288+
expect(actual[0]).toBe(expected);
286289

287-
let actual = convertAdgToUbo('example.org#%#//scriptlet("ubo-abort-on-property-read.js", "alert")');
288-
let expected = 'example.org##+js(abort-on-property-read, alert)';
290+
actual = convertAdgToUbo('example.org#%#//scriptlet("ubo-abort-on-property-read.js", "alert")');
291+
expected = 'example.org##+js(abort-on-property-read, alert)';
289292
expect(actual).toBe(expected);
290293

291294
actual = convertAdgToUbo('example.org#%#//scriptlet("abort-on-property-write", "adblock.check")');

0 commit comments

Comments
 (0)