Skip to content

Commit

Permalink
test: remove test of internals
Browse files Browse the repository at this point in the history
  • Loading branch information
imnotjames committed Jun 21, 2021
1 parent 1877423 commit ffcc621
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions test/functional/util/OrmUtils.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
import { expect } from "chai";
import { OrmUtils } from "../../../src/util/OrmUtils";

describe("OrmUtils.isPlainObject", () => {
const isPlainObject = OrmUtils.isPlainObject.bind(OrmUtils);

it("should return `true` if the Object is made by Object.create(null), {} or new Object().", () => {
class Foo {}

expect(isPlainObject(new Object())).to.be.true;
expect(isPlainObject(Object.create(null))).to.be.true;
expect(isPlainObject(Object.create(Object.prototype))).to.be.true;
expect(isPlainObject({ foo: "bar" })).to.be.true;
expect(isPlainObject({ constructor: "foo" })).to.be.true;
expect(isPlainObject({ constructor: Foo })).to.be.true;
expect(isPlainObject({}));
});

it("should return `false` if the Object is not made by Object.create(null), {} or new Object().", () => {
class Foo {}

expect(isPlainObject(Object.create({}))).to.be.false;
expect(isPlainObject(Object.create(Object))).to.be.false;
expect(isPlainObject(/foo/)).to.be.false;
expect(isPlainObject(function() {})).to.be.false;
expect(isPlainObject(() => {})).to.be.false;
expect(isPlainObject(["foo", "bar"])).to.be.false;
expect(isPlainObject([])).to.be.false;
expect(isPlainObject(new Foo())).to.be.false;
expect(isPlainObject(null)).to.be.false;
expect(isPlainObject(Math)).to.be.false;
expect(isPlainObject(Error)).to.be.false;
expect(isPlainObject(0)).to.be.false;
expect(isPlainObject(false)).to.be.false;
expect(isPlainObject(NaN)).to.be.false;
});
});

describe("OrmUtils.mergeDeep", () => {
const mergeDeep = OrmUtils.mergeDeep.bind(OrmUtils);

Expand Down

0 comments on commit ffcc621

Please sign in to comment.