10 Commits

Author SHA1 Message Date
e2cab0bb59 1.0.21 2020-09-23 23:30:55 +00:00
aaaa8b3ee4 fix(core): update 2020-09-23 23:30:54 +00:00
4cc149069e 1.0.20 2020-07-28 17:24:53 +00:00
6c106a4f22 fix(core): update 2020-07-28 17:24:53 +00:00
85fca378ff 1.0.19 2020-07-28 17:14:17 +00:00
d096a08e42 fix(core): update 2020-07-28 17:14:16 +00:00
a715dd9e8c 1.0.18 2020-07-26 15:02:25 +00:00
ef8bf0a0d8 fix(core): update 2020-07-26 15:02:24 +00:00
f6d8910c45 1.0.17 2020-07-26 14:34:48 +00:00
0917b9dd06 fix(core): update 2020-07-26 14:34:47 +00:00
3 changed files with 1680 additions and 1271 deletions

2917
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@apiglobal/test-sdk", "name": "@apiglobal/test-sdk",
"version": "1.0.16", "version": "1.0.21",
"private": false, "private": false,
"description": "an sdk for testing ag handlers", "description": "an sdk for testing ag handlers",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@@ -12,18 +12,18 @@
"build": "(tsbuild --web)" "build": "(tsbuild --web)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.0.22", "@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.43", "@gitzone/tstest": "^1.0.44",
"@pushrocks/tapbundle": "^3.2.9", "@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.0.26", "@types/node": "^14.11.2",
"tslint": "^6.1.2", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@apiglobal/sdk": "^1.0.9", "@apiglobal/sdk": "^1.0.13",
"@apiglobal/typedrequest": "^1.0.40", "@apiglobal/typedrequest": "^1.0.43",
"@apiglobal/typedrequest-interfaces": "^1.0.15", "@apiglobal/typedrequest-interfaces": "^1.0.15",
"@pushrocks/smartexpress": "^3.0.73", "@pushrocks/smartexpress": "^3.0.76",
"@pushrocks/smartobject": "^1.0.4" "@pushrocks/smartobject": "^1.0.4"
}, },
"files": [ "files": [

View File

@@ -6,8 +6,13 @@ export {
}; };
let testServer: AgTestServer; let testServer: AgTestServer;
export const createTestServer = async (handlerArg: plugins.agSdk.AAgHandler<any>) => { export const createTestServer = async (handlerArg: { new(envHandler: plugins.agSdk.AgEnvironment): plugins.agSdk.AAgHandler<any> }) => {
testServer = new AgTestServer(handlerArg); class AgEnvironement extends plugins.agSdk.AgEnvironment {
public async getEnvVar(nameArg: string) {
return '';
}
}
testServer = new AgTestServer(new handlerArg(new AgEnvironement()));
await testServer.start(); await testServer.start();
return testServer; return testServer;
}; };
@@ -38,7 +43,13 @@ export const testFire = <
if (comparisonResult.divergingProperties.length > 0) { if (comparisonResult.divergingProperties.length > 0) {
console.log(`The following properties diverged:`); console.log(`The following properties diverged:`);
console.log(comparisonResult.divergingProperties); console.log(comparisonResult.divergingProperties);
throwErrorBool = true; for (const divProperty of comparisonResult.divergingProperties) {
if (expectedResponseArg[divProperty] !== 'maydiverge') {
throwErrorBool = true;
} else {
console.log(`${divProperty} may diverge, not throwing for this one`);
}
}
} }
if (comparisonResult.missingProperties.length > 0) { if (comparisonResult.missingProperties.length > 0) {
console.log(`The following properties diverged:`); console.log(`The following properties diverged:`);
@@ -48,6 +59,7 @@ export const testFire = <
if (throwErrorBool) { if (throwErrorBool) {
throw new Error('response did not comply'); throw new Error('response did not comply');
} }
return actualResponse;
}; };
return { return {
expect expect