possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG enable / disable colors in the output (reporters and logs) preprocess matching files before serving them to the browser 'node_modules/angular-mocks/angular-mocks.js', list of files / patterns to load in the browser base path that will be used to resolve all patterns (eg. Generated on Tue 13:50:13 GMT-0500 (Eastern Standard Time) The config file for the above project looks like below: // Karma configuration Run karma init and go through the prompts for creating the karma config file. The new project directory structure looks as below:Ĭreate a new directory called tests where all the required tests will go. This will add new folders to the project root directory (node_modules) and also some new configuration files such as package.json and. Npm install karma-chrome-launcher -save-dev Npm install karma-jasmine jasmine-core -save-dev From the terminal of VC or from the command line move to the root directory of the application project and run the below commands to install the angular, jasmine and karma dependencies. I am using Visual Code as the development environment for writing the test cases. Note that the system needs to have nodejs installed as a prerequisite.Ĭhecking for node version can be done by node -version Using Angular CLI and npm a series of packages and dependencies were installed. Once the test cases were written they need to be continuously executed through karma and their code coverage obtained. I decided to pick up a few of the core components such as instant search and order form component and write tests for the respective controllers and filters being used.
0 Comments
Leave a Reply. |