diff --git a/src/__tests__/cipher-text.test.ts b/src/__tests__/cipher-text.test.ts index 4759083..ed5cc32 100644 --- a/src/__tests__/cipher-text.test.ts +++ b/src/__tests__/cipher-text.test.ts @@ -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({ @@ -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({ @@ -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() @@ -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 })