mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 13:47:12 +00:00
test: add unit test for assert for increase coverage to 100%
This commit is contained in:
parent
b922729093
commit
4364c7264b
@ -1,6 +1,17 @@
|
||||
import { assertDefined, assertDefinedAndNotNull } from "./assert";
|
||||
import { assert, assertDefined, assertDefinedAndNotNull } from "./assert";
|
||||
|
||||
describe("assert", () => {
|
||||
|
||||
describe("assert", () => {
|
||||
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', () => {
|
||||
expect(() => assert(false)).toThrowError("condition is not truthy");
|
||||
});
|
||||
});
|
||||
|
||||
describe("assertDefined", () => {
|
||||
it("passes for simple values", () => {
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user