Skip to content

Commit 9c42536

Browse files
committed
tests tests tests
1 parent a70bf6c commit 9c42536

File tree

10 files changed

+1447
-7
lines changed

10 files changed

+1447
-7
lines changed

integration-tests/testkit/seed.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import {
6060
import { execute } from './graphql';
6161
import { UpdateSchemaPolicyForOrganization, UpdateSchemaPolicyForProject } from './schema-policy';
6262
import { collect, CollectedOperation, legacyCollect } from './usage';
63-
import { generateUnique } from './utils';
63+
import { generateUnique, getServiceHost } from './utils';
6464

6565
export function initSeed() {
6666
function createConnectionPool() {
@@ -89,6 +89,15 @@ export function initSeed() {
8989
},
9090
authenticate,
9191
generateEmail: () => userEmail(generateUnique()),
92+
async purgeOrganizationAccessTokenById(id: string) {
93+
const registryAddress = await getServiceHost('server', 8082);
94+
await fetch(
95+
'http://' + registryAddress + '/cache/organization-access-token-cache/delete/' + id,
96+
{
97+
method: 'POST',
98+
},
99+
).then(res => res.json());
100+
},
92101
async createOwner() {
93102
const ownerEmail = userEmail(generateUnique());
94103
const auth = await authenticate(ownerEmail);

integration-tests/testkit/utils.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,12 @@ export function assertNonNull<T>(
111111
throw new Error(message);
112112
}
113113
}
114+
115+
export function assertNonNullish<T>(
116+
value: T | null | undefined,
117+
message = 'Expected non-null value.',
118+
): asserts value is T {
119+
if (value === null) {
120+
throw new Error(message);
121+
}
122+
}

0 commit comments

Comments
 (0)