AngularJs开发环境搭建

1. 安装Sublime Text3

经常使用插件安装:AngularJs, Autoprefixer, BracketHighlighter,ConvertToUTF8,CSScomb,DocBlockr,Emmet,Git,GitGutter,Jquery,JsFormat,SideBarEnhancements,SublimeCodeIntel,SublimeLinter(jshint,csslint),Tag,Terminal,TrailingSpaces

其中SublimeLinter须要用到NodeJs,并安装jshint和csslint, npm install -g jshint
javascript

2. 安装Bower依赖css

安装好Bower后,经过bower install 安装angularjs  bootstrap java

3. 搭建单元测试环境angularjs

karma 单元测试容器
npm

karma-jasmine 编写单元测试
bootstrap

karma-coverage 代码覆盖率
浏览器

karma-firefox-launcher 
bash

初始化配置文件 karma init框架

Which testing framework do you want to use ?

Press tab to list possible options. Enter to move to the next question.

> jasmine

注:测试框架选择

Do you want to use Require.js ?

This will add Require.js plugin.

Press tab to list possible options. Enter to move to the next question.

> yes

注:需不须要引入requirejs

引入requirejs的缘由:加载相互依赖的js文件

Do you want to capture a browser automatically ?

Press tab to list possible options. Enter empty string to move to the next question.

> Chrome

> 

注:选择打开的浏览器

What is the location of your source and test files ?

You can use glob patterns, eg. "js/*.js" or "test/**/*Spec.js".

Enter empty string to move to the next question.

> 

注:karma启动时加载的目标文件和测试文件

Should any of the files included by the previous patterns be excluded ?

You can use glob patterns, eg. "**/*.swp".

Enter empty string to move to the next question.

> 

注:加载的目标文件不须要测试的文件

Do you want Karma to watch all the files and run the tests on change ?

Press tab to list possible options.

> yes

注:karma要不要动态监听目标文件和测试用例变化

Config file generated at "D:\workspace\javascript\karma\karma.conf.js".

这个指令跑完后你就会发现目录底下多了个配置文件karma.conf.js,test-main.js

karma.conf.js:  karma配置文件

test-main.js:    requireJS配置文件

 运行测试用例  karma startide

4. 搭建集成测试环境

 Protractor

待续。。。