Skip to content

Commit

Permalink
fix: formatting (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocorradini authored Feb 22, 2024
1 parent 77d2e95 commit a86cef5
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 48 deletions.
16 changes: 10 additions & 6 deletions tests/functional/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ describe("crud resolvers execution", () => {
}
`;
await generateCodeFromSchema(prismaSchema, { outputDirPath });
const { UserCrudResolver } = require(outputDirPath +
"/resolvers/crud/User/UserCrudResolver.ts");
const { UserCrudResolver } = require(
outputDirPath + "/resolvers/crud/User/UserCrudResolver.ts",
);

graphQLSchema = await buildSchema({
resolvers: [UserCrudResolver],
Expand Down Expand Up @@ -351,8 +352,10 @@ describe("crud resolvers execution", () => {
}
`;
await generateCodeFromSchema(prismaSchema, { outputDirPath });
const { FirstModelCrudResolver } = require(outputDirPath +
"/resolvers/crud/FirstModel/FirstModelCrudResolver.ts");
const { FirstModelCrudResolver } = require(
outputDirPath +
"/resolvers/crud/FirstModel/FirstModelCrudResolver.ts",
);

graphQLSchema = await buildSchema({
resolvers: [FirstModelCrudResolver],
Expand Down Expand Up @@ -409,8 +412,9 @@ describe("crud resolvers execution", () => {
}
`;
await generateCodeFromSchema(prismaSchema, { outputDirPath });
const { UserCrudResolver } = require(outputDirPath +
"/resolvers/crud/User/UserCrudResolver.ts");
const { UserCrudResolver } = require(
outputDirPath + "/resolvers/crud/User/UserCrudResolver.ts",
);

graphQLSchema = await buildSchema({
resolvers: [UserCrudResolver],
Expand Down
56 changes: 24 additions & 32 deletions tests/functional/enhance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ describe("custom resolvers execution", () => {
});

it("should properly apply decorators in enhance map", async () => {
const {
applyResolversEnhanceMap,
PostCrudResolver,
} = require(outputDirPath);
const { applyResolversEnhanceMap, PostCrudResolver } = require(
outputDirPath,
);

applyResolversEnhanceMap({
Post: {
Expand Down Expand Up @@ -76,10 +75,9 @@ describe("custom resolvers execution", () => {
}, 10000);

it("should properly apply decorators for all methods when `_all` is used", async () => {
const {
applyResolversEnhanceMap,
PostCrudResolver,
} = require(outputDirPath);
const { applyResolversEnhanceMap, PostCrudResolver } = require(
outputDirPath,
);

applyResolversEnhanceMap({
Post: {
Expand Down Expand Up @@ -123,10 +121,9 @@ describe("custom resolvers execution", () => {
}, 10000);

it("should properly apply decorators for selected crud methods when `_query` is used", async () => {
const {
applyResolversEnhanceMap,
PostCrudResolver,
} = require(outputDirPath);
const { applyResolversEnhanceMap, PostCrudResolver } = require(
outputDirPath,
);

applyResolversEnhanceMap({
Post: {
Expand Down Expand Up @@ -157,10 +154,9 @@ describe("custom resolvers execution", () => {
}, 10000);

it("should properly apply decorators for selected crud methods when `_mutation` is used", async () => {
const {
applyResolversEnhanceMap,
PostCrudResolver,
} = require(outputDirPath);
const { applyResolversEnhanceMap, PostCrudResolver } = require(
outputDirPath,
);

applyResolversEnhanceMap({
Post: {
Expand Down Expand Up @@ -191,10 +187,9 @@ describe("custom resolvers execution", () => {
}, 10000);

it("should allow overwrite decorators when `_all` is used", async () => {
const {
applyResolversEnhanceMap,
PostCrudResolver,
} = require(outputDirPath);
const { applyResolversEnhanceMap, PostCrudResolver } = require(
outputDirPath,
);

applyResolversEnhanceMap({
Post: {
Expand Down Expand Up @@ -244,10 +239,9 @@ describe("custom resolvers execution", () => {
}, 10000);

it("should inject decorators to decorator fn when `_all` is used", async () => {
const {
applyResolversEnhanceMap,
PostCrudResolver,
} = require(outputDirPath);
const { applyResolversEnhanceMap, PostCrudResolver } = require(
outputDirPath,
);

let injectedDecorators: Function[] | undefined;
applyResolversEnhanceMap({
Expand All @@ -271,10 +265,9 @@ describe("custom resolvers execution", () => {
}, 10000);

it("should concat decorators when `_all` and method specific are used together", async () => {
const {
applyResolversEnhanceMap,
PostCrudResolver,
} = require(outputDirPath);
const { applyResolversEnhanceMap, PostCrudResolver } = require(
outputDirPath,
);

applyResolversEnhanceMap({
Post: {
Expand All @@ -299,10 +292,9 @@ describe("custom resolvers execution", () => {

it("should properly apply descriptor decorators in enhance map", async () => {
let descriptorCalledFlag = false;
const {
applyResolversEnhanceMap,
PostCrudResolver,
} = require(outputDirPath);
const { applyResolversEnhanceMap, PostCrudResolver } = require(
outputDirPath,
);

applyResolversEnhanceMap({
Post: {
Expand Down
5 changes: 3 additions & 2 deletions tests/functional/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ describe("errors", () => {
}
`;
await generateCodeFromSchema(prismaSchema, { outputDirPath });
const { UserCrudResolver } = require(outputDirPath +
"/resolvers/crud/User/UserCrudResolver.ts");
const { UserCrudResolver } = require(
outputDirPath + "/resolvers/crud/User/UserCrudResolver.ts",
);

graphQLSchema = await buildSchema({
resolvers: [UserCrudResolver],
Expand Down
7 changes: 3 additions & 4 deletions tests/functional/picking-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ describe("picking prisma actions", () => {
});

it("should expose in GraphQL schema only actions chosen by single resolvers", async () => {
const {
CreateOneUserResolver,
FindManyUserResolver,
} = require(outputDirPath + "/index");
const { CreateOneUserResolver, FindManyUserResolver } = require(
outputDirPath + "/index",
);
await buildSchema({
resolvers: [CreateOneUserResolver, FindManyUserResolver],
validate: false,
Expand Down
10 changes: 6 additions & 4 deletions tests/functional/renaming-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ describe("crud resolvers execution", () => {
}
`;
await generateCodeFromSchema(prismaSchema, { outputDirPath });
const { UserCrudResolver } = require(outputDirPath +
"/resolvers/crud/User/UserCrudResolver.ts");
const { UserCrudResolver } = require(
outputDirPath + "/resolvers/crud/User/UserCrudResolver.ts",
);
const graphQLSchema = await buildSchema({
resolvers: [UserCrudResolver],
validate: false,
Expand Down Expand Up @@ -69,8 +70,9 @@ describe("crud resolvers execution", () => {
}
`;
await generateCodeFromSchema(prismaSchema, { outputDirPath });
const { UserCrudResolver } = require(outputDirPath +
"/resolvers/crud/User/UserCrudResolver.ts");
const { UserCrudResolver } = require(
outputDirPath + "/resolvers/crud/User/UserCrudResolver.ts",
);
const graphQLSchema = await buildSchema({
resolvers: [UserCrudResolver],
validate: false,
Expand Down

0 comments on commit a86cef5

Please sign in to comment.