Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed May 19, 2021
1 parent b89df8b commit a8546a0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/unit/proof.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect } from "chai";
import { ArrayObject, SimpleObject } from "./objects";

describe("create proof", () => {
it("should include all leaves of path to composite type", () => {
const arrayObj = ArrayObject.defaultTreeBacked();
const simpleObj = SimpleObject.defaultTreeBacked();
arrayObj.v.push(simpleObj);
const proof = arrayObj.createProof([["v"]]);
const arrayObj2 = ArrayObject.createTreeBackedFromProofUnsafe(proof);
expect(arrayObj2.v[0].valueOf()).to.deep.equal(arrayObj.v[0].valueOf());
expect(arrayObj2.v.valueOf()).to.deep.equal(arrayObj.v.valueOf());
});
});

0 comments on commit a8546a0

Please sign in to comment.