vscode-angular2-test-snippetsFollowing John Papa's example on his handful vscode-angular2-snippets, here is my vscode-angular2-test-snippets which is a collection of code snippets bringing recipes for each type of common in Angular 2 framework. InstallationSearch for "angular2 test" in Visual Studio Code, or just jump straight to https://marketplace.visualstudio.com/items?itemName=MarinhoBrandao.Angular2Tests You can alternatively fork/clone/download this repository and copy and paste the content of
Snippetsng2-test-componentBasic component test recipe, including basic operations on DOM ng2-test-component-routedThis is a more complex component, including route manipulation, spying methods and manipulation of change detection. ng2-test-component-propertiesTest recipe covering a component with Input, Output and HostBinding. ng2-test-component-serviceTest recipe covering a component with async and sync services. ng2-test-directiveTest recipe to cover a Directive, with a mocked container component implementing such
directive as an example of it. Includes basic coverage on the DOM ng2-test-formRecipe for isolated unit test covering a Reactive Form. ng2-test-guardRecipe for isolated unit test covering a Route Guard. ng2-test-pipeTest recipe covering a Pipe, which is mostly a single pure function in a class. Works mostly as simple unit test, but with Pipe basic structure. ng2-test-observableBasic test recipe covering observable and respective subscriptions. ng2-test-reduxTest recipe covering an action and consequent state change consuming by how it is implemented in ng2-redux and Redux. ng2-test-without-testbedThe most basic type of test, which totally unit driven, ideal to write isolated tests of specific pure functions, classes and reducers. ng2-test-serviceA simple test recipe using ng2-test-mockbackendA test recipe using MockBackend and MockConnection to mock HTTP requests. To be done
How this repository is maintained?It follows as close as possible the standards recommended in https://angular.io/docs/ts/latest/guide/testing.html How to contribute?If you see these snippets are outdated according to the URL above, file your Pull Request with updates or just let me know through the (issues section)[./issues/]. Have fun! |