1
1
# Developing AngularJS
2
2
3
3
* [ Development Setup] ( #setup )
4
+ * [ Running Tests] ( #tests )
4
5
* [ Coding Rules] ( #rules )
5
6
* [ Commit Message Guidelines] ( #commits )
6
7
* [ Writing Documentation] ( #documentation )
@@ -107,6 +108,8 @@ HTTP server. For this purpose, we have made available a local web server based o
107
108
http://localhost:8000/build/docs/
108
109
```
109
110
111
+ ## <a name =" tests " > Running Tests
112
+
110
113
### <a name =" unit-tests " ></a > Running the Unit Test Suite
111
114
112
115
We write unit and integration tests with Jasmine and execute them with Karma. To run all of the
@@ -116,24 +119,27 @@ tests once on Chrome run:
116
119
yarn grunt test:unit
117
120
```
118
121
119
- To run the tests on other browsers (Chrome, ChromeCanary, Firefox and Safari are pre-configured) use:
122
+ To run the tests on other browsers (Chrome and Firefox are pre-configured) use:
120
123
121
124
``` shell
122
125
yarn grunt test:unit --browsers=Chrome,Firefox
123
126
```
124
127
125
128
** Note:** there should be _ no spaces between browsers_ . ` Chrome, Firefox ` is INVALID.
126
129
130
+ If you want to test locally on Safari, Internet Explorer, or Edge, you must install
131
+ the respective ` karma-<browser>-launcher ` from npm.
132
+
127
133
If you have a Saucelabs or Browserstack account, you can also run the unit tests on these services
128
- via our pre-defined customLaunchers.
134
+ via our pre-defined customLaunchers. See the [ karma config file ] ( /karma-shared.conf.js ) for all pre-configured browsers.
129
135
130
- For example, to run the whole unit test suite:
136
+ For example, to run the whole unit test suite on selected browsers :
131
137
132
138
``` shell
133
139
# Browserstack
134
- yarn grunt test:unit --browsers=BS_Chrome,BS_Firefox,BS_Safari,BS_IE_9,BS_IE_10,BS_IE_11,BS_EDGE,BS_iOS_8,BS_iOS_9, BS_iOS_10
140
+ yarn grunt test:unit --browsers=BS_Chrome,BS_Firefox,BS_Safari,BS_IE_9,BS_IE_10,BS_IE_11,BS_EDGE,BS_iOS_10
135
141
# Saucelabs
136
- yarn grunt test:unit --browsers=BS_Chrome,BS_Firefox,BS_Safari,BS_IE_9,BS_IE_10,BS_IE_11,BS_EDGE,BS_iOS_8,BS_iOS_9,BS_iOS_10
142
+ yarn grunt test:unit --browsers=SL_Chrome,SL_Firefox,SL_Safari,SL_IE_9,SL_IE_10,SL_IE_11,SL_EDGE,SL_iOS_10
137
143
```
138
144
139
145
Running these commands requires you to set up [ Karma Browserstack] [ karma-browserstack ] or
@@ -483,4 +489,4 @@ You can see an example of a well-defined example [in the `ngRepeat` documentatio
483
489
[ karma-browserstack ] : https://github.com/karma-runner/karma-browserstack-launcher
484
490
[ karma-saucelabs ] : https://github.com/karma-runner/karma-sauce-launcher
485
491
[ unit-testing ] : https://docs.angularjs.org/guide/unit-testing
486
- [ yarn-install ] : https://yarnpkg.com/en/docs/install
492
+ [ yarn-install ] : https://yarnpkg.com/en/docs/install
0 commit comments