fix: fix lint issue

This commit is contained in:
vector 2023-12-08 10:20:42 +08:00
parent 441a25ed78
commit 9c49f68f97

View File

@ -1,17 +1,16 @@
import { assert, assertDefined, assertDefinedAndNotNull } from "./assert";
describe("assert", () => {
describe("assert", () => {
it('assert should not throw an error when condition is truthy', () => {
it("assert should not throw an error when condition is truthy", () => {
expect(() => assert(true)).not.toThrow();
});
it('assert should throw an error with default message when condition is falsy', () => {
it("assert should throw an error with default message when condition is falsy", () => {
expect(() => assert(false)).toThrowError("condition is not truthy");
});
it('assert should throw an error with custom message when condition is falsy', () => {
it("assert should throw an error with custom message when condition is falsy", () => {
const errorMessage = "Custom error message";
expect(() => assert(false, errorMessage)).toThrowError(errorMessage);
});