diff --git a/test/crypto.ts b/test/crypto.ts index 25ff5333..b4870f3b 100644 --- a/test/crypto.ts +++ b/test/crypto.ts @@ -66,47 +66,3 @@ t.test('parseCert missing expiration time', async t => { 'should throw parse ephemeral cert error' ); }); - -t.test('parseCert no x509 parser fallback', async t => { - const {cryptoModule} = t.mockRequire('../src/node-crypto', {}); - const {parseCert} = t.mockRequire('../src/crypto', { - '../src/node-crypto': { - async cryptoModule() { - const mod = cryptoModule(); - return { - ...mod, - X509Certificate: undefined, - }; - }, - }, - }); - const {cert, expirationTime} = await parseCert(CLIENT_CERT); - t.same(cert, CLIENT_CERT, 'should return original cert in response'); - t.same( - expirationTime, - 'Jul 22 17:53:09 3022 GMT', - 'should return expiration time' - ); -}); - -t.test('parseCert no x509 parser fallback failure', async t => { - const {cryptoModule} = t.mockRequire('../src/node-crypto', {}); - const {parseCert} = t.mockRequire('../src/crypto', { - '../src/node-crypto': { - async cryptoModule() { - const mod = cryptoModule(); - return { - ...mod, - X509Certificate: undefined, - }; - }, - }, - }); - return t.rejects( - parseCert('-----BEGIN PUBLIC KEY-----'), - { - code: 'EPARSESQLADMINEPH', - }, - 'should throw parse ephemeral cert error' - ); -});