test: fix types on tests

This commit is contained in:
cedoor
2024-03-28 12:52:16 +00:00
parent 56c7fc8b23
commit fa4d9860e4
2 changed files with 7 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ describe("Group", () => {
it("Should create a group", () => {
const group = new Group()
expect(group.root).toBe("0")
expect(group.root).toBe(0n)
expect(group.depth).toBe(0)
expect(group.size).toBe(0)
})
@@ -19,7 +19,7 @@ describe("Group", () => {
group2.addMember(2n)
group2.addMember(3n)
expect(group.root).toContain(group2.root)
expect(group.root).toBe(group2.root)
expect(group.depth).toBe(2)
expect(group.size).toBe(3)
})
@@ -64,7 +64,7 @@ describe("Group", () => {
group.updateMember(0, 1n)
expect(group.size).toBe(2)
expect(group.members[0]).toBe("1")
expect(group.members[0]).toBe(1n)
})
})
@@ -76,7 +76,7 @@ describe("Group", () => {
group.removeMember(0)
expect(group.size).toBe(2)
expect(group.members[0]).toBe("0")
expect(group.members[0]).toBe(0n)
})
})
@@ -88,7 +88,7 @@ describe("Group", () => {
const proof = group.generateMerkleProof(0)
expect(proof.leaf).toBe("1")
expect(proof.leaf).toBe(1n)
})
})

View File

@@ -47,7 +47,7 @@ describe("Proof", () => {
proof = await generateProof(identity, group, message, scope, treeDepth)
expect(typeof proof).toBe("object")
expect(proof.merkleTreeRoot).toBe(group.root)
expect(BigInt(proof.merkleTreeRoot)).toBe(group.root)
}, 20000)
it("Should generate a Semaphore proof passing a Merkle proof instead of a group", async () => {
@@ -56,7 +56,7 @@ describe("Proof", () => {
proof = await generateProof(identity, group.generateMerkleProof(2), message, scope, treeDepth)
expect(typeof proof).toBe("object")
expect(proof.merkleTreeRoot).toBe(group.root)
expect(BigInt(proof.merkleTreeRoot)).toBe(group.root)
}, 20000)
})