From 0f932badf339afa4bfa6907a758b5b5b566fcfde Mon Sep 17 00:00:00 2001 From: Giovanni Minotti Date: Thu, 10 Sep 2020 21:56:52 +0200 Subject: [PATCH] Disable a test as the built-in `openssl` on macOS does not support negative days (#1457) Co-authored-by: Sindre Sorhus --- test/https.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/test/https.ts b/test/https.ts index 9d69ccb3a..97d739217 100644 --- a/test/https.ts +++ b/test/https.ts @@ -115,14 +115,17 @@ test('https request with `checkServerIdentity` NOT OK', withHttpsServer(), async ); }); -test('https request with expired certificate', withHttpsServer({days: -1}), async (t, _server, got) => { - await t.throwsAsync( - got({}), - { - code: 'CERT_HAS_EXPIRED' - } - ); -}); +// The built-in `openssl` on macOS does not support negative days. +if (process.platform !== 'darwin') { + test('https request with expired certificate', withHttpsServer({days: -1}), async (t, _server, got) => { + await t.throwsAsync( + got({}), + { + code: 'CERT_HAS_EXPIRED' + } + ); + }); +} test('https request with wrong host', withHttpsServer({commonName: 'not-localhost.com'}), async (t, _server, got) => { await t.throwsAsync(