fix(core): update

This commit is contained in:
2022-02-15 18:53:02 +01:00
parent 145505b891
commit db80f2df7e
6 changed files with 18984 additions and 3886 deletions

View File

@ -1,31 +1,23 @@
import { tap, expect } from '@pushrocks/tapbundle';
import { tap, expect, expectAsync } from '@pushrocks/tapbundle';
import * as smartrequest from '../ts/index';
tap.test('should request a html document over https', async () => {
await expect(smartrequest.getJson('https://encrypted.google.com/'))
.to.eventually.property('body')
.be.a('string');
await expect(smartrequest.getJson('https://encrypted.google.com/'))
.to.eventually.property('body')
.be.a('string');
await expect(smartrequest.getJson('https://encrypted.google.com/'))
.to.eventually.property('body')
.be.a('string');
await expectAsync(smartrequest.getJson('https://encrypted.google.com/')).toHaveProperty('body')
});
tap.test('should request a JSON document over https', async () => {
await expect(smartrequest.getJson('https://jsonplaceholder.typicode.com/posts/1'))
.to.eventually.property('body')
await expectAsync(smartrequest.getJson('https://jsonplaceholder.typicode.com/posts/1'))
.property('body')
.property('id')
.equal(1);
.toEqual(1);
});
tap.skip.test('should post a JSON document over http', async () => {
await expect(smartrequest.postJson('http://md5.jsontest.com/?text=example_text'))
.to.eventually.property('body')
await expectAsync(smartrequest.postJson('http://md5.jsontest.com/?text=example_text'))
.property('body')
.property('md5')
.equal('fa4c6baa0812e5b5c80ed8885e55a8a6');
.toEqual('fa4c6baa0812e5b5c80ed8885e55a8a6');
});
tap.skip.test('should deal with unix socks', async () => {