AppSync
A collection of matchers to test AWS AppSync mapping templates and JS resolvers.
Helper Functions
appSyncResolver(input: AppSyncResolverInput)
appSyncResolver(input: AppSyncResolverInput)Use the appSyncResolver helper function to test JS resolvers.
code: The path to a file containing anAPPSYNC_JSresolver code. The path can either be absolute, or relative to the working directory (process.cwd()).function: The function to test. Must berequestorresponse.context: The context object to be passed to the function
appSyncMappingTemplate(input: AppSyncMappingTemplateInput)
appSyncMappingTemplate(input: AppSyncMappingTemplateInput)Use the appSyncMappingTemplate helper function to test VTL mapping templates.
template: The path to a file containing a mapping template. The path can either be absolute, or relative to the working directory (process.cwd()).context: The context object to be injected into the template
Matchers
toEvaluateTo<E>(expected: E)
toEvaluateTo<E>(expected: E)Asserts that a mapping template or resolver evaluates to a given object for a given context.
toEvaluateToSnapshot(propertiesOrHint?: string, hint?: string)
toEvaluateToSnapshot(propertiesOrHint?: string, hint?: string)Asserts that the evaluated template matches the most recent snapshot. It works similarly to jest's toMatchSnapshot.
toEvaluateToInlineSnapshot(propertiesOrHint?: string, hint?: string)
toEvaluateToInlineSnapshot(propertiesOrHint?: string, hint?: string)Asserts that the evaluated template matches the most recent snapshot. It works similarly to jest's toMatchInlineSnapshot.
Last updated
Was this helpful?