Skip to content

Commit

Permalink
update generateClient tests
Browse files Browse the repository at this point in the history
  • Loading branch information
david-mcafee committed Dec 11, 2023
1 parent 467faaf commit 8095221
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 155 deletions.
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
// Optionally specify a single test file to run/debug:
"AWSAppSyncRealTimeProvider.test.ts",
"generateClient.test.ts",
"--runInBand",
"--testTimeout",
"600000", // 10 min timeout so jest doesn't error while we're stepping through code
"false"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"runtimeExecutable": "/Users/mcafd/.nvm/versions/node/v18.17.0/bin/node"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,63 @@ exports[`generateClient basic model operations - custom client and request heade
]
`;

exports[`generateClient basic model operations - custom client and request headers can create() - with custom client header functions that pass requestOptions 1`] = `
[
[
{
"abortController": AbortController {},
"options": {
"body": {
"query": "mutation ($input: CreateTodoInput!) {
createTodo(input: $input) {
id
name
description
status
tags
createdAt
updatedAt
todoMetaId
owner
}
}
",
"variables": {
"input": {
"description": "something something",
"name": "some name",
},
},
},
"headers": {
"X-Api-Key": "FAKE-KEY",
"rq-method": "POST",
"rq-qs": "mutation ($input: CreateTodoInput!) {
createTodo(input: $input) {
id
name
description
status
tags
createdAt
updatedAt
todoMetaId
owner
}
}
",
"rq-url": "https://localhost/graphql",
"x-amz-user-agent": "aws-amplify/latest api/latest framework/latest",
},
"signingServiceInfo": undefined,
"withCredentials": undefined,
},
"url": "https://localhost/graphql",
},
],
]
`;

exports[`generateClient basic model operations - custom client and request headers can create() - with custom client headers 1`] = `
[
[
Expand Down Expand Up @@ -2856,6 +2913,63 @@ exports[`generateClient basic model operations - custom client and request heade
]
`;

exports[`generateClient basic model operations - custom client and request headers can create() - with custom request header function that accept requestOptions 1`] = `
[
[
{
"abortController": AbortController {},
"options": {
"body": {
"query": "mutation ($input: CreateTodoInput!) {
createTodo(input: $input) {
id
name
description
status
tags
createdAt
updatedAt
todoMetaId
owner
}
}
",
"variables": {
"input": {
"description": "something something",
"name": "some name",
},
},
},
"headers": {
"X-Api-Key": "FAKE-KEY",
"rq-method": "POST",
"rq-qs": "mutation ($input: CreateTodoInput!) {
createTodo(input: $input) {
id
name
description
status
tags
createdAt
updatedAt
todoMetaId
owner
}
}
",
"rq-url": "https://localhost/graphql",
"x-amz-user-agent": "aws-amplify/latest api/latest framework/latest",
},
"signingServiceInfo": undefined,
"withCredentials": undefined,
},
"url": "https://localhost/graphql",
},
],
]
`;

exports[`generateClient basic model operations - custom client and request headers can create() - with custom request headers 1`] = `
[
[
Expand Down
Loading

0 comments on commit 8095221

Please sign in to comment.