Skip to content

Commit

Permalink
chore: stop printing prototype in Jest snapshots (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored May 24, 2023
1 parent 9b6f8a6 commit 5ee1eb7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions jest.project.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = ({ dirname, projectMode = true }) => {
resolver: './node_modules/bob-the-bundler/jest-resolver.cjs',
snapshotFormat: {
escapeString: false,
printBasicPrototype: false,
},
};
};
Original file line number Diff line number Diff line change
@@ -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<Result, Parent = {}, Context = {}, Args = {}> = (
parent: Parent,
args: Args,
Expand Down Expand Up @@ -177,7 +177,7 @@ export type DirectiveResolvers<ContextType = any> = {
authenticated?: AuthenticatedDirectiveResolver<any, any, ContextType>,
};
",
"prepend": Array [
"prepend": [
"import { type GraphQLResolveInfo, type GraphQLScalarType, type GraphQLScalarTypeConfig } from 'graphql';",
"export type $RequireFields<Origin, Keys> = $Diff<Origin, Keys> & $ObjMapi<Keys, <Key>(k: Key) => $NonMaybeType<$ElementType<Origin, Key>>>;",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const mockUpdateUserMutation = (resolver: ResponseResolver<GraphQLRequest
`;
exports[`msw Should generate mocks based on queries and mutations: imports 1`] = `
Array [
[
"import { graphql, ResponseResolver, GraphQLRequest, GraphQLContext } from 'msw'",
]
`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`TypeScript Nhost Plugin should generate the nhost-compatible schema 1`] = `
Object {
{
"content": "/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
Expand Down Expand Up @@ -723,7 +723,7 @@ export default {
Query_SearchArgs: Query_SearchArgs
}
}",
"prepend": Array [
"prepend": [
"export type Maybe<T> = T | null;",
"export type InputMaybe<T> = Maybe<T>;",
"export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down

0 comments on commit 5ee1eb7

Please sign in to comment.