Kill crypto subprocess so tests actually finish running

This commit is contained in:
Daniel Lugo 2021-12-16 11:11:11 -04:00
parent 5542d7b8db
commit 8e4d948172
4 changed files with 22 additions and 4 deletions

View file

@ -210,5 +210,11 @@ module.exports = {
authorizeDevice,
generateRandomString,
nodeKeyPairs,
devicePublicKeys
devicePublicKeys,
/**
* Used for tests.
*/
killECCCryptoSubprocess() {
cryptoSubprocess.kill()
}
}

View file

@ -12,7 +12,8 @@ const {
decryptMessage,
encryptMessage,
generateKeyPair,
isAuthorizedDevice
isAuthorizedDevice,
killECCCryptoSubprocess
} = require('./ECC')
const uuid = () => {
@ -118,4 +119,6 @@ describe('ECC', () => {
expect(decrypted).toEqual(message)
})
})
after(killECCCryptoSubprocess)
})

View file

@ -136,5 +136,11 @@ module.exports = {
convertBufferToBase64,
convertToEncryptedMessage,
convertToEncryptedMessageResponse,
processKey
processKey,
/**
* Used for tests.
*/
killCryptoCryptoSubprocess() {
cryptoSubprocess.kill()
}
}

View file

@ -7,7 +7,8 @@ const expect = require('expect')
const {
generateRandomString,
convertBase64ToBuffer,
convertBufferToBase64
convertBufferToBase64,
killCryptoCryptoSubprocess
} = require('./crypto')
describe('crypto', () => {
@ -33,4 +34,6 @@ describe('crypto', () => {
expect(asStringAgain).toEqual(rnd)
})
})
after(killCryptoCryptoSubprocess)
})