![]() ![]() ![]() Remember to keep your Controllers thin, so too many unit tests for latters is a red flag. In Angular's case a typical unit is Angular Component ( Service, Factory, Provider, Controller, Filter, Directive etc). Unit test is for a single unit of your source code. This feature of Karma to run only a set of files is what makes it perfect for fast tests running in background upon each source file edit, and get immediate feedback, which is brilliant! The only negative is the "noisy" error reporting that will hopefully improve! Each karma process launches its own set of browsers (these are currently available). You can have multiple karma config files for different purposes, which you can run in parallel or one-by-one. These can be all your source files, some of them, some of them plus some additional files or files irrelevant to your project, only providing some extra configuration - you name it! ![]() (For non-JavaScript external templates, Angular's Unit Testing Guide recommends using Karma html preprocessor to compile them into JavaScript first.) Karma is a test runner that will run the JavaScript files specified in you configuration file explicitly or using node-globs. Karma FAQ actually does refer to Adapter for Angular's Scenario Runner, which, however, seems to be abandoned, with Protractor being recommended instead. I'd like to clarify some possible misconceptions about Karma and Protractor. Here is a simple package I've created to add minimal Karma setup to any project with one single command npm install min-karma. ![]()
0 Comments
Leave a Reply. |