Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyione committed Nov 5, 2020
1 parent 6686205 commit 117ab9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .tests/apiTestCase.json

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion tests/common/apiTestRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ export class ApiTestRunner {
): Promise<any> {
if (this.mock) {
this.mockExample(operation);
if (operation.operationId === 'createRunningJob') {
return {
code: 200,
data: {
taskRoles: {
worker: {
taskStatuses: [ { containerId: 'id' } ]
}
}
}
};
}
}

const client: any = operation.cluster ?
Expand Down Expand Up @@ -136,7 +148,7 @@ export class ApiTestRunner {
data: operation.response.expectResult ||
op.examples[operation.response!.statusCode!] || {}
};
} else {
} else if (op) {
for (const code of Object.keys(op.examples)) {
if (code.startsWith('20')) {
example = {
Expand All @@ -145,6 +157,8 @@ export class ApiTestRunner {
};
}
}
} else {
return;
}
}
let pathString: string = op.path.replace(new RegExp('{(.*)}', 'gi'), '(.*)');
Expand Down

0 comments on commit 117ab9b

Please sign in to comment.