NO TRY , NO HIGH
官网是这么定义的:
On the AngularJS team,we rely on testing and we always seek better tools to make our life easier.
That's why we created Karma- a test runner that fits all our needs.
简单的说,Karma是用来干什么的呢?
The main goal for Karma is to bring a productive testing environment to developers.
The environment being one where they don't have to set up loads of configurations,but rather a place
where developers can just write the code and get instant feedback from their tests.
Because getting quick feedback is what makes you productive and creative.
总结下,Karma是一个测试运行器,它可以将开发,CI,产品等不同环境下测试所需要的配置管理起来。从而使程序员只专注于写测试本身。Karma可以是测试驱动开发更加的简单,高效,有趣。
需要注意的是,Karma不是测试框架,也不是断言库。它只是能够启动一个HTTP服务器,依赖于测试框架,生成你可能已经知道的测试运行器的HTML文件。
Karma在2013年前也叫Testacular.
如果你现在去搜索Testacular,会链接到Karma资源处。
Karma runs on Node.js and is available as an NPM package.
$ npm install karma –save-dev
$ npm install karma-jasmine karma-chrome-launcher …… –save-dev
$ karma init my.conf.js
Browsers
the browsers configuration setting is empty by default.
Preprocessors
$ ./node_modules/karma/bin/karma start my.conf.js
$ npm install -g karma-cli
$ karma start my.conf.js
npm install grunt –save-dev
npm install grunt-karma –save-dev
- Run tests from browsers or PhantomJS
- Run on multiple clients at once
- Supports multiple JavaScript test frameworks
- Auto-run tests on save
- Reporters
- Plugins
- Supported by IntelliJ and WebStorm
- Open source
---
- No plugin for Eclipse (yet)
- No history of previous test results