appsync-template-tester
Use
Example
yarn add appsync-template-tester --dev
import Parser from 'appsync-template-tester';
import { readFileSync } from 'fs';
import { join } from 'path';
const templateFilePath = join(__dirname, './pathToFile.vtl');
const template = readFileSync(templateFilePath);
const parser = new Parser(template);
test('Test the resolver', () => {
const context = {
result: {
id: 'testId',
},
};
const response = parser.resolve(context);
expect(response.id).toBe('testId');
});
Util helpers supported
This module supports all the provided $util methods, which can be seen in the Resolver Mapping Template Utility Reference
docs.
Note: The errors list is not exported (and cannot be without modifying the velocityjs compiler).
Skyhook CD Checklist
CD Feature | Provided |
---|
✅ | Typescript |
✅ | Linting (AirBnB + Prettier) |
✅ | Unit tests (Jest) |
✅ | Coverage check (ideally 100% with Jest) |
✅ | Github Continuous Deployment |
Built by Skyhook
This module is contributed by the team at Skyhook.