Skip to content

Commit

Permalink
attempt to fix race condition in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s0l0ist committed May 23, 2024
1 parent dfd37d4 commit b3be6f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/__tests__/cipher-text.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ describe('CipherText', () => {
expect(seal.CipherText.constructor.name).toBe('Function')
})
test('It should construct an instance', () => {
const Constructor = jest.fn(seal.CipherText)
const Constructor = jest.fn(() => seal.CipherText())
Constructor()
expect(Constructor).toHaveBeenCalledWith()
})
test('It should construct an instance with a bfvContext', () => {
const Constructor = jest.fn(seal.CipherText)
const Constructor = jest.fn(options => seal.CipherText(options))
Constructor({ context: bfvContext })
expect(Constructor).toHaveBeenCalledWith({ context: bfvContext })
})
test('It should construct an instance with a bfvContext, parmsId', () => {
const Constructor = jest.fn(seal.CipherText)
const Constructor = jest.fn(options => seal.CipherText(options))
const parmsId = bfvContext.firstParmsId
Constructor({ context: bfvContext, parmsId })
expect(Constructor).toHaveBeenCalledWith({
Expand All @@ -83,7 +83,7 @@ describe('CipherText', () => {
})
})
test('It should construct an instance with a bfvContext, parmsId, sizeCapacity', () => {
const Constructor = jest.fn(seal.CipherText)
const Constructor = jest.fn(options => seal.CipherText(options))
const parmsId = bfvContext.firstParmsId
Constructor({ context: bfvContext, parmsId, sizeCapacity: 2 })
expect(Constructor).toHaveBeenCalledWith({
Expand All @@ -93,7 +93,7 @@ describe('CipherText', () => {
})
})
test('It should fail to construct an instance from invalid parameters', () => {
const Constructor = jest.fn(seal.CipherText)
const Constructor = jest.fn(options => seal.CipherText(options))
expect(() =>
Constructor({ context: bfvContext, sizeCapacity: 2 })
).toThrow()
Expand All @@ -103,7 +103,7 @@ describe('CipherText', () => {
})
})
test('It should fail to construct an instance from bad parameters', () => {
const Constructor = jest.fn(seal.CipherText)
const Constructor = jest.fn(options => seal.CipherText(options))
const parmsId = bfvContext.firstParmsId
expect(() =>
Constructor({ context: bfvContext, parmsId, sizeCapacity: -2 })
Expand Down

0 comments on commit b3be6f9

Please sign in to comment.