-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AG-18170 improve isEmptyObject - should not be function #268
Merge in ADGUARD-FILTERS/scriptlets from fix/AG-18170 to master Squashed commit of the following: commit 0390052 Merge: 180e595 d85c776 Author: Stanislav A <s.atroschenko@adguard.com> Date: Tue Dec 13 20:46:10 2022 +0300 Merge branch 'master' into fix/AG-18170 commit 180e595 Author: Stanislav A <s.atroschenko@adguard.com> Date: Tue Dec 13 18:05:41 2022 +0300 fix version commit 2febad3 Author: Stanislav A <s.atroschenko@adguard.com> Date: Tue Dec 13 16:51:14 2022 +0300 update changelog commit 19c6c85 Author: Stanislav A <s.atroschenko@adguard.com> Date: Tue Dec 13 15:47:46 2022 +0300 improve helper commit f52e9a1 Author: Stanislav A <s.atroschenko@adguard.com> Date: Tue Dec 13 15:47:04 2022 +0300 improve helper and add tests commit 817493a Author: Stanislav A <s.atroschenko@adguard.com> Date: Tue Dec 13 14:50:36 2022 +0300 improve isEmptyObject - should not be function
- Loading branch information
1 parent
d85c776
commit c33826b
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { isEmptyObject } from '../../src/helpers'; | ||
|
||
const { test, module } = QUnit; | ||
const name = 'scriptlets-redirects helpers'; | ||
|
||
module(name); | ||
|
||
test('Test isEmptyObject works for different inputs', async (assert) => { | ||
const emptyObj = {}; | ||
const obj = { a: 1 }; | ||
const emptyArr = []; | ||
const arr = [1, 2, 3]; | ||
function func() {} | ||
|
||
assert.ok(isEmptyObject(emptyObj), 'empty object returns true'); | ||
assert.ok(isEmptyObject(emptyArr), 'empty array returns true'); | ||
|
||
assert.notOk(isEmptyObject(obj), 'non-empty object returns false'); | ||
assert.notOk(isEmptyObject(arr), 'non-empty array returns false'); | ||
|
||
assert.notOk(isEmptyObject(EventTarget)); | ||
assert.notOk(isEmptyObject(Array)); | ||
assert.notOk(isEmptyObject(Object)); | ||
assert.notOk(isEmptyObject(Function)); | ||
assert.notOk(isEmptyObject(func)); | ||
}); |