Skip to content

Commit

Permalink
✅ Migrate isObject tests to new system (and archive 100% coverage)
Browse files Browse the repository at this point in the history
  • Loading branch information
EinfachLeo committed Jul 30, 2024
1 parent adc3103 commit 76dead1
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions test/types/object/object.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { describe, expect, it } from "vitest";
import {isObject} from "../../../src";
import { describe } from "vitest";
import { assertIsNotObject, assertIsObject, assertIsObjectOrNull, isObject } from "../../../src";
import { testIs } from '../../helper/checker';
import { testAssertIs, testAssertIsNot, testAssertIsOrNull } from '../../helper/assertions';

const tests = [
const baseTests: Array<[string, unknown, boolean]> = [
["null", null, false],
["undefined", undefined, false],
["true", true, false],
Expand Down Expand Up @@ -31,10 +33,12 @@ const tests = [
["date", new Date, true],
]

describe("isObject", () => {
for (const test of tests) {
it("should be " + (test[2] ? 'positive' : 'negative') + " about " + test[0], () => {
expect(isObject(test[1])).toBe(test[2]);
});
}
describe("object checker", () => {
testIs(isObject, baseTests);
});

describe("object assertions", () => {
testAssertIs(assertIsObject, baseTests);
testAssertIsNot(assertIsNotObject, baseTests);
testAssertIsOrNull(assertIsObjectOrNull, baseTests);
});

0 comments on commit 76dead1

Please sign in to comment.