Move the isEmptyObj helper function from src/shared/util.js to test/unit/test_utils.js

Since this helper function is no longer used anywhere in the main code-base, but only in a couple of unit-tests, it's thus being moved to a more appropriate spot.

Finally, the implementation of `isEmptyObj` is also tweaked slightly by removing the manual loop.
This commit is contained in:
Jonas Jenwald 2020-06-09 16:48:03 +02:00
parent 159e13c4e4
commit 88fdb482b0
4 changed files with 10 additions and 20 deletions

View file

@ -19,7 +19,6 @@ import {
createValidAbsoluteUrl,
isArrayBuffer,
isBool,
isEmptyObj,
isNum,
isSameOrigin,
isString,
@ -89,16 +88,6 @@ describe("util", function () {
});
});
describe("isEmptyObj", function () {
it("handles empty objects", function () {
expect(isEmptyObj({})).toEqual(true);
});
it("handles non-empty objects", function () {
expect(isEmptyObj({ foo: "bar" })).toEqual(false);
});
});
describe("isNum", function () {
it("handles numeric values", function () {
expect(isNum(1)).toEqual(true);