fix(core): update

This commit is contained in:
2023-02-12 17:54:00 +01:00
parent ac65f4c85f
commit a46af3a431
9 changed files with 71 additions and 14666 deletions

View File

@ -2,10 +2,9 @@ import { expect, tap } from '@pushrocks/tapbundle';
import * as webrequest from '../ts/index.js';
tap.test('should run multiendpoint request', async (tools) => {
const response = await new webrequest.WebRequest()
.request('https://api.signup.software', {
method: 'GET',
})
const response = await new webrequest.WebRequest().request('https://api.signup.software', {
method: 'GET',
});
console.log(JSON.stringify(await response.text()));
});

View File

@ -43,14 +43,19 @@ tap.test('setup test server', async () => {
});
tap.test('first test', async (tools) => {
const response = await (await new webrequest.WebRequest().requestMultiEndpoint([
'http://localhost:2345/apiroute1',
'http://localhost:2345/apiroute2',
'http://localhost:2345/apiroute4',
'http://localhost:2345/apiroute3',
], {
method: 'GET'
})).json();
const response = await (
await new webrequest.WebRequest().requestMultiEndpoint(
[
'http://localhost:2345/apiroute1',
'http://localhost:2345/apiroute2',
'http://localhost:2345/apiroute4',
'http://localhost:2345/apiroute3',
],
{
method: 'GET',
}
)
).json();
const response2 = await new webrequest.WebRequest().getJson('http://localhost:2345/apiroute3');
@ -68,6 +73,6 @@ tap.test('should cache response', async () => {
await testServer.stop();
const response2 = await webrequestInstance.getJson('http://localhost:2345/apiroute3', true);
expect(response2).toHaveProperty('hithere');
})
});
tap.start();