diff --git a/test/api/ApolloGraphClient.test.ts b/test/api/ApolloGraphClient.test.ts index c818d5624..f78102e02 100644 --- a/test/api/ApolloGraphClient.test.ts +++ b/test/api/ApolloGraphClient.test.ts @@ -18,7 +18,7 @@ describe("graph/ApolloGraphClient", () => { describe("ApolloGraphClient", () => { let headers: any; - before(function() { + before(function(this: any): void { if (AtomistApiKey) { headers = { Authorization: `Bearer ${AtomistApiKey}` }; } else { @@ -48,7 +48,7 @@ describe("graph/ApolloGraphClient", () => { }); }).timeout(5000); - it("should run repos query and clone repo", async function() { + it("should run repos query and clone repo", async function(this: any): Promise { if (!GitHubToken) { this.skip(); } @@ -70,10 +70,12 @@ describe("graph/ApolloGraphClient", () => { const gitHead = p.findFileSync(".git/HEAD"); assert(gitHead); assert(gitHead.path === ".git/HEAD"); - await p.release(); } catch (e) { - await p.release(); throw e; + } finally { + if (p && p.release) { + p.release(); + } } }).timeout(10000); diff --git a/test/graphql/query/repos.graphql b/test/graphql/query/repos.graphql index ff5f01f5c..5df5fdc98 100644 --- a/test/graphql/query/repos.graphql +++ b/test/graphql/query/repos.graphql @@ -1,11 +1,10 @@ - query Repos($teamId: ID!, $offset: Int!) { - ChatTeam(id: $teamId) { - orgs { - repo(first: 100, offset: $offset) { - owner - name - } - } + ChatTeam(id: $teamId) { + orgs(owner: "atomisthq") { + repo(first: 100, offset: $offset) { + owner + name + } } + } }