From 5ee1eb72c4d02db06b8fbe6e744d916f617063bf Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Wed, 24 May 2023 11:05:30 +0200 Subject: [PATCH] chore: stop printing prototype in Jest snapshots (#354) --- jest.project.js | 1 + .../resolvers/tests/__snapshots__/flow-resolvers.spec.ts.snap | 4 ++-- .../typescript/msw/tests/__snapshots__/msw.spec.ts.snap | 2 +- .../typescript/nhost/tests/__snapshots__/nhost.spec.ts.snap | 4 ++-- yarn.lock | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/jest.project.js b/jest.project.js index eddeb0129..45f727881 100644 --- a/jest.project.js +++ b/jest.project.js @@ -27,6 +27,7 @@ module.exports = ({ dirname, projectMode = true }) => { resolver: './node_modules/bob-the-bundler/jest-resolver.cjs', snapshotFormat: { escapeString: false, + printBasicPrototype: false, }, }; }; diff --git a/packages/plugins/flow/resolvers/tests/__snapshots__/flow-resolvers.spec.ts.snap b/packages/plugins/flow/resolvers/tests/__snapshots__/flow-resolvers.spec.ts.snap index 35956338a..6853c31c6 100644 --- a/packages/plugins/flow/resolvers/tests/__snapshots__/flow-resolvers.spec.ts.snap +++ b/packages/plugins/flow/resolvers/tests/__snapshots__/flow-resolvers.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Flow Resolvers Plugin Should generate basic type resolvers 1`] = ` -Object { +{ "content": "export type Resolver = ( parent: Parent, args: Args, @@ -177,7 +177,7 @@ export type DirectiveResolvers = { authenticated?: AuthenticatedDirectiveResolver, }; ", - "prepend": Array [ + "prepend": [ "import { type GraphQLResolveInfo, type GraphQLScalarType, type GraphQLScalarTypeConfig } from 'graphql';", "export type $RequireFields = $Diff & $ObjMapi(k: Key) => $NonMaybeType<$ElementType>>;", ], diff --git a/packages/plugins/typescript/msw/tests/__snapshots__/msw.spec.ts.snap b/packages/plugins/typescript/msw/tests/__snapshots__/msw.spec.ts.snap index 687bf2b4e..7981f132a 100644 --- a/packages/plugins/typescript/msw/tests/__snapshots__/msw.spec.ts.snap +++ b/packages/plugins/typescript/msw/tests/__snapshots__/msw.spec.ts.snap @@ -112,7 +112,7 @@ export const mockUpdateUserMutation = (resolver: ResponseResolver = T | null;", "export type InputMaybe = Maybe;", "export type Exact = { [K in keyof T]: T[K] };", diff --git a/yarn.lock b/yarn.lock index dfb9d51d2..fa9b0c60e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7833,7 +7833,7 @@ yargs-parser@^18.1.2, yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^21.0.0, yargs-parser@^21.0.1, yargs-parser@^21.1.1: +yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==