ava-recipes READMEA set of snippets created for a crash course webinar on unit testing a node typescript application using ava. The goal of the Testing Recipes approach is a simple yet robust way of building tests. Whether or not you use proper TDD, a test runner is a highly underutilized tool for confirming that new code is working as you develop it. Part of the problem is confusion about the core concepts, which the webinar attempts to help. To use them, you should at least check out the wiki for the course. It is recommended to use this together with the ava-launch extension for launching the debugger from an ava test. FeaturesThere are two sets of snippets for typescript test files:
Not every snippet has a RecipesAssertions
Testing
Stubbingstub-constant stub a function or other imported contant. AVA specs for TypescriptFor convenience, inside of a package.json the ava snippet will pop in recommended ava settings for a ts project. LimitationsThese are not intended to be perfect, just to save some time. You can expect to have to move things around in your test and make modifications at times. What's intended here is a best guess at what you are likely to need. It could be that if people like these we can develop a lot more. Another limitation, but intentional, is that we sacrifice options for simplicity. The goal is that anyone can create robust tests with clarity from the beginning. So the recipes are intended to work all of the time, at the cost of not always being the ideal way to implement them.
Release NotesCheck out the Change Log |