mirror of
https://github.com/semaphore-protocol/semaphore.git
synced 2026-01-10 07:08:17 -05:00
test: fix types on tests
This commit is contained in:
@@ -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)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user