Skip to content

Commit

Permalink
fix: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mgagliardo91 authored and cdaringe committed Jun 10, 2022
1 parent 7af624d commit 3660350
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/__tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test.beforeEach(async (t) => {
create table no_primary_keys(
name text
)
`)
`);
const middleware = postgraphile(t.context.client, "public", {
graphiql: true,
appendPlugins: [PgMutationUpsertPlugin],
Expand Down Expand Up @@ -95,9 +95,9 @@ const fetchMutationTypes = async (t: PluginExecutionContext) => {
}
}
}
`
return execGqlOp(t, query)
}
`;
return execGqlOp(t, query);
};

const fetchAllBikes = async (t: PluginExecutionContext) => {
const query = nanographql`
Expand Down Expand Up @@ -153,14 +153,17 @@ const create = async (t: PluginExecutionContext) =>
);

test("ignores tables without primary keys", async (t) => {
await create(t)
const res = await fetchMutationTypes(t)
const upsertMutations = new Set(res.data.__type.fields.map(({ name }) => name).filter((name) => name.startsWith('upsert')))
t.assert(upsertMutations.size === 2)
t.assert(upsertMutations.has('upsertBike'))
t.assert(upsertMutations.has('upsertRole'))

})
await create(t);
const res = await fetchMutationTypes(t);
const upsertMutations = new Set(
res.data.__type.fields
.map(({ name }) => name)
.filter((name) => name.startsWith("upsert"))
);
t.assert(upsertMutations.size === 2);
t.assert(upsertMutations.has("upsertBike"));
t.assert(upsertMutations.has("upsertRole"));
});

test("upsert crud", async (t) => {
await create(t);
Expand Down

0 comments on commit 3660350

Please sign in to comment.