Skip to content

Commit

Permalink
test: update test infra to use bigger heap size
Browse files Browse the repository at this point in the history
  • Loading branch information
justynoh committed Dec 10, 2023
1 parent 513acfc commit 2e64320
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
${{ runner.OS }}-
- run: npm ci
- run: npm run test-ci
env:
NODE_OPTIONS: '--max-old-space-size=8192'
- name: Submit test coverage to Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module.exports = {
global: {
statements: 85,
functions: 80,
}
}
},
},
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"test": "jest",
"test": "NODE_OPTIONS=\"--max-old-space-size=8192\" jest",
"test-ci": "jest --coverage",
"test-watch": "jest --watch",
"build": "tsc",
Expand Down
6 changes: 4 additions & 2 deletions src/crypto-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import {
FormFieldsV3,
} from './types'

export default class CryptoV3 {
generate = generateKeypair
export default class CryptoV3 extends CryptoBase {
constructor() {
super()
}

/**
* Encrypt input with a unique keypair for each submission.
Expand Down
7 changes: 3 additions & 4 deletions src/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import {
convertEncryptedAttachmentToFileContent,
decryptContent,
encryptMessage,
generateKeypair,
verifySignedMessage,
} from './util/crypto'
import { determineIsFormFields } from './util/validate'
import CryptoBase from './crypto-base'
import { AttachmentDecryptionError, MissingPublicKeyError } from './errors'
import {
DecryptedAttachments,
Expand All @@ -29,15 +29,14 @@ import {
FormField,
} from './types'

export default class Crypto {
export default class Crypto extends CryptoBase {
signingPublicKey?: string

constructor({ signingPublicKey }: { signingPublicKey?: string } = {}) {
super()
this.signingPublicKey = signingPublicKey
}

generate = generateKeypair

/**
* Encrypt input with a unique keypair for each submission
* @param encryptionPublicKey The base-64 encoded public key for encrypting.
Expand Down

0 comments on commit 2e64320

Please sign in to comment.