Skip to content

Commit

Permalink
Fix spurious test failure
Browse files Browse the repository at this point in the history
The GraphQL Repos query was returning a deleted repo.
  • Loading branch information
David Dooling committed Apr 22, 2020
1 parent a7ede6e commit e1e5d8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
10 changes: 6 additions & 4 deletions test/api/ApolloGraphClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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<void> {
if (!GitHubToken) {
this.skip();
}
Expand All @@ -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);

Expand Down
15 changes: 7 additions & 8 deletions test/graphql/query/repos.graphql
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}

0 comments on commit e1e5d8d

Please sign in to comment.