Skip to content

Commit

Permalink
updated to cover 100% branches
Browse files Browse the repository at this point in the history
  • Loading branch information
N00ts committed Jun 30, 2021
1 parent 4e26dbb commit 33290eb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/unit/helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { INode } from "../../src/structure/INode";
import { ensureState } from '../../src/misc/helpers';

test("test", () => {
test("Expect to initialize state", () => {
const n : INode = {};
ensureState(n);
expect(n.state).toBeDefined();
});
});

test("Expect not to initalize state", () => {
const n: INode = {
state: {
checked: true
}
}
ensureState(n);
expect(n.state).toMatchObject(n.state);
})

0 comments on commit 33290eb

Please sign in to comment.