Skip to content

Commit

Permalink
first attempt at test
Browse files Browse the repository at this point in the history
  • Loading branch information
markdboyd committed Aug 31, 2020
1 parent 795da40 commit 83d6157
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/https.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
import test from 'ava';
import { readFileSync } from 'fs';
import { createServer } from 'https';
import * as path from 'path';
import got, {CancelableRequest} from '../source';
import withServer from './helpers/with-server';
import {DetailedPeerCertificate} from 'tls';
import pEvent from 'p-event';
// import { resetBehavior } from 'sinon';

test.serial.only('testing', async (t) => {
const options = {
pfx: readFileSync(path.resolve('test/fixtures/test.pfx')),
passphrase: 'test'
};

const server = createServer(options, (_, res) => {
res.end('ok');
})
server.listen(9189);

await got('http://localhost:9189');

t.pass();
});

test('https request without ca', withServer, async (t, server, got) => {
server.get('/', (_request, response) => {
Expand Down

0 comments on commit 83d6157

Please sign in to comment.