fix(core): update to latest standards

This commit is contained in:
2018-06-13 22:34:49 +02:00
parent 8c941fe1b7
commit 97bbb8b38b
15 changed files with 552 additions and 439 deletions

View File

@ -1,25 +1,27 @@
import 'typings-test'
import 'typings-test';
import { tap, expect } from 'tapbundle'
import { tap, expect } from 'tapbundle';
import * as smartrequest from '../ts/index'
import * as smartrequest from '../ts/index';
tap.test('should request a html document over https', async () => {
await expect(
smartrequest.get('https://encrypted.google.com/')
).to.eventually.property('body').be.a('string')
})
await expect(smartrequest.get('https://encrypted.google.com/'))
.to.eventually.property('body')
.be.a('string');
});
tap.test('should request a JSON document over https', async () => {
await expect(
smartrequest.get('https://jsonplaceholder.typicode.com/posts/1')
).to.eventually.property('body').property('id').equal(1)
})
await expect(smartrequest.get('https://jsonplaceholder.typicode.com/posts/1'))
.to.eventually.property('body')
.property('id')
.equal(1);
});
tap.test('should post a JSON document over http', async () => {
await expect(
smartrequest.post('http://md5.jsontest.com/?text=example_text')
).to.eventually.property('body').property('md5').equal('fa4c6baa0812e5b5c80ed8885e55a8a6')
})
await expect(smartrequest.post('http://md5.jsontest.com/?text=example_text'))
.to.eventually.property('body')
.property('md5')
.equal('fa4c6baa0812e5b5c80ed8885e55a8a6');
});
tap.start()
tap.start();