8 Commits

Author SHA1 Message Date
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
0455c34cfa 1.0.16 2020-07-26 14:01:17 +00:00
a69fee7985 fix(core): update 2020-07-26 14:01:17 +00:00
4 changed files with 16 additions and 6 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "@apiglobal/test-sdk",
"version": "1.0.15",
"version": "1.0.19",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@apiglobal/test-sdk",
"version": "1.0.15",
"version": "1.0.19",
"private": false,
"description": "an sdk for testing ag handlers",
"main": "dist_ts/index.js",

View File

@@ -38,7 +38,13 @@ export const testFire = <
if (comparisonResult.divergingProperties.length > 0) {
console.log(`The following properties diverged:`);
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) {
console.log(`The following properties diverged:`);
@@ -48,6 +54,7 @@ export const testFire = <
if (throwErrorBool) {
throw new Error('response did not comply');
}
return expectedResponseArg;
};
return {
expect

View File

@@ -6,14 +6,17 @@ export class AgTestServer {
constructor(handlerArg?: plugins.agSdk.AAgHandler<any>) {
if (handlerArg) {
this.handlers.push(handlerArg);
this.addAgHandler(handlerArg);
}
}
public async addAgHandler(handlerArg: plugins.agSdk.AAgHandler<any>) {
this.handlers.push(handlerArg);
await this.stop();
await this.start();
console.log(`added handler with slug ${handlerArg.slug}`);
if (this.server && this.server.serverStatus === 'running') {
await this.stop();
await this.start();
}
}
public async start() {