Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamWr committed Oct 21, 2022
1 parent 85a7677 commit 45daa0b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/redirects/googlesyndication-adsbygoogle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,14 @@ test('Redirect testing', (assert) => {
assert.strictEqual(window.adsbygoogle.push.length, 1, 'push.length check');
const pushCallback = (arg) => {
try {
let check = false;
if (arg) {
check = true;
}
// Test for https://github.com/AdguardTeam/Scriptlets/issues/252
// If arg is not defined then error will be thrown
if (arg.whatever) {
arg.whatever = 1;
}
assert.strictEqual(check, true, 'callback was called');
assert.ok(typeof arg !== 'undefined', 'arg is defined');
} catch (error) {
const check = false;
assert.strictEqual(check, true, 'something went wrong');
assert.ok(false, 'something went wrong');
}
};
const pushArg = {
Expand Down

0 comments on commit 45daa0b

Please sign in to comment.