Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4cc149069e | |||
| 6c106a4f22 | |||
| 85fca378ff | |||
| d096a08e42 | |||
| a715dd9e8c | |||
| ef8bf0a0d8 | |||
| f6d8910c45 | |||
| 0917b9dd06 | |||
| 0455c34cfa | |||
| a69fee7985 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/test-sdk",
|
||||
"version": "1.0.15",
|
||||
"version": "1.0.20",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/test-sdk",
|
||||
"version": "1.0.15",
|
||||
"version": "1.0.20",
|
||||
"private": false,
|
||||
"description": "an sdk for testing ag handlers",
|
||||
"main": "dist_ts/index.js",
|
||||
|
||||
@@ -38,7 +38,13 @@ export const testFire = <
|
||||
if (comparisonResult.divergingProperties.length > 0) {
|
||||
console.log(`The following properties diverged:`);
|
||||
console.log(comparisonResult.divergingProperties);
|
||||
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 actualResponse;
|
||||
};
|
||||
return {
|
||||
expect
|
||||
|
||||
@@ -6,15 +6,18 @@ 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);
|
||||
console.log(`added handler with slug ${handlerArg.slug}`);
|
||||
if (this.server && this.server.serverStatus === 'running') {
|
||||
await this.stop();
|
||||
await this.start();
|
||||
}
|
||||
}
|
||||
|
||||
public async start() {
|
||||
this.server = new plugins.smartexpress.Server({
|
||||
|
||||
Reference in New Issue
Block a user