Skip to content

Commit

Permalink
Disable a test as the built-in openssl on macOS does not support ne…
Browse files Browse the repository at this point in the history
…gative days (#1457)

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
Giotino and sindresorhus committed Sep 10, 2020
1 parent 876bff0 commit 0f932ba
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/https.ts
Expand Up @@ -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(
Expand Down

0 comments on commit 0f932ba

Please sign in to comment.