fix(core): update

This commit is contained in:
Philipp Kunz 2022-02-10 18:02:07 +01:00
parent 1bb08bfb7f
commit adadd2c100
4 changed files with 19977 additions and 3823 deletions

23730
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,19 +13,19 @@
"format": "(gitzone format)" "format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@gitzone/tsbuild": "^2.1.29",
"@gitzone/tsbundle": "^1.0.78", "@gitzone/tsbundle": "^1.0.89",
"@gitzone/tstest": "^1.0.52", "@gitzone/tstest": "^1.0.60",
"@pushrocks/smartexpress": "^3.0.76", "@pushrocks/smartexpress": "^3.0.108",
"@pushrocks/tapbundle": "^3.2.9", "@pushrocks/tapbundle": "^4.0.3",
"@types/node": "^14.11.8", "@types/node": "^17.0.17",
"tslint": "^6.1.3", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartdelay": "^2.0.10", "@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartenv": "^4.0.15", "@pushrocks/smartenv": "^4.0.16",
"@pushrocks/smartjson": "^4.0.5", "@pushrocks/smartjson": "^4.0.6",
"node-fetch": "^2.6.1" "node-fetch": "^2.6.1"
}, },
"files": [ "files": [

View File

@ -55,8 +55,8 @@ tap.test('first test', async (tools) => {
console.log('response 1: ' + JSON.stringify(response)); console.log('response 1: ' + JSON.stringify(response));
console.log('response 2: ' + JSON.stringify(response2)); console.log('response 2: ' + JSON.stringify(response2));
expect(response).property('hithere').to.equal('hi'); expect(response).toHaveProperty('hithere') //.to.equal('hi');
expect(response2).property('hithere').to.equal('hi'); expect(response2).toHaveProperty('hithere') //.to.equal('hi');
}); });
tap.test('tear down server', async () => { tap.test('tear down server', async () => {

View File

@ -72,6 +72,7 @@ export class WebRequest {
optionsArg: { optionsArg: {
method: 'GET' | 'POST' | 'PUT' | 'DELETE'; method: 'GET' | 'POST' | 'PUT' | 'DELETE';
body?: any; body?: any;
headers?: HeadersInit;
} }
): Promise<Response> { ): Promise<Response> {
let allUrls: string[]; let allUrls: string[];
@ -106,7 +107,7 @@ export class WebRequest {
}; };
// lets go recursive // lets go recursive
const doRequest = async (urlToUse: string) => { const doRequest = async (urlToUse: string): Promise<any> => {
if (!urlToUse) { if (!urlToUse) {
throw new Error('request failed permanently'); throw new Error('request failed permanently');
} }
@ -115,6 +116,7 @@ export class WebRequest {
method: optionsArg.method, method: optionsArg.method,
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
...(optionsArg.headers || {})
}, },
body: optionsArg.body, body: optionsArg.body,
}); });