13
13
<a name="H1_1"></a>
14
14
# License
15
15
16
- `Angular` is an open source project licensed under the {@link
16
+ AngularJS is an open source project licensed under the {@link
17
17
http://github.com/angular/angular.js/blob/master/LICENSE MIT license}. Your contributions are
18
- always welcome. When working with `angular` source base, please follow the guidelines provided on
18
+ always welcome. When working with AngularJS code base, please follow the guidelines provided on
19
19
this page.
20
20
21
21
22
22
<a name="H1_2"></a>
23
23
# Contributing to Source Code
24
24
25
- We'd love for you to contribute to our source code and to make `angular` even better than it is
26
- today! Here are the guidelines we'd like you to use :
25
+ We'd love for you to contribute to our source code and to make AngularJS even better than it is
26
+ today! Here are the guidelines we'd like you to follow :
27
27
28
- * Major changes that you intend to contribute to the project must be discussed first on our {@link
28
+ * Major changes that you intend to contribute to the project should be discussed first on our {@link
29
29
https://groups.google.com/forum/?hl=en#!forum/angular mailing list} so that we can better
30
30
coordinate our efforts, prevent duplication of work, and help you to craft the change so that it
31
31
is successfully accepted upstream.
@@ -64,45 +64,43 @@ inheritance only when absolutely necessary.
64
64
external API. See our existing code to see what we mean.
65
65
66
66
* We don't go crazy with type annotations for private internal APIs unless it's an internal API
67
- that is used throughout `angular` . The best guidance is to do what makes the most sense.
67
+ that is used throughout AngularJS . The best guidance is to do what makes the most sense.
68
68
69
69
70
70
<a name="H1_4"></a>
71
71
# Checking Out and Building Angular
72
72
73
- The `angular` source code is hosted at {@link http://github.com Github}, which we also use to
74
- accept code contributions. Several steps are needed to check out and build `angular` :
73
+ The AngularJS source code is hosted at {@link http://github.com Github}, which we also use to
74
+ accept code contributions. Several steps are needed to check out and build AngularJS :
75
75
76
76
77
77
## Installation Dependencies
78
78
79
- Before you can build `angular` , you must install or configure the following dependencies on your
79
+ Before you can build AngularJS , you must install or configure the following dependencies on your
80
80
machine:
81
81
82
82
* {@link http://rake.rubyforge.org Rake}: We use Rake as our build system, which is pre-installed
83
83
on most Macintosh and Linux machines. If that is not true in your case, you can grab it from the
84
84
Rake website.
85
85
86
+ * Git: The {@link http://help.github.com/mac-git-installation Github Guide to Installing Git} is
87
+ quite a good source for information on Git.
88
+
86
89
* {@link http://nodejs.org Node.js}: We use Node to generate the documentation and to run a
87
90
development web server. Depending on your system, you can install Node either from source or as a
88
91
pre-packaged bundle.
89
92
90
- You'll also need npm and the following npm modules:
93
+ Once installed, you'll also need several npms (node packages), which you can install once you checked out a local copy
94
+ of the Angular repository (see below) with:
91
95
92
- * install npm: `curl http://npmjs.org/install.sh | sh`
93
- * install q: `npm install q`
94
- * install qq: `npm install qq`
95
- * install q-fs: `npm install q-fs`
96
- * install jasmine-node: `npm install jasmine`
96
+ * `cd angular.js`
97
+ * `npm install`
97
98
98
99
100
+ * Lastly, you'll also need Testacular our spectacular test runner that we use for running unit and end-to-end tests.
99
101
100
- * Java: The Java runtime is used to run {@link http://code.google.com/p/js-test-driver
101
- JsTestDriver} (JSTD), which we use to run our unit test suite. JSTD binaries are part of the
102
- `angular` source base, which means there is no need to install or configure it separately.
102
+ * `sudo npm install -g testacular`
103
103
104
- * Git: The {@link http://help.github.com/mac-git-installation Github Guide to Installing Git} is
105
- quite a good source for information on Git.
106
104
107
105
108
106
## Creating a Github Account and Forking Angular
@@ -112,31 +110,31 @@ Afterwards, go ahead and {@link http://help.github.com/forking fork} the {@link
112
110
https://github.com/angular/angular.js main angular repository}.
113
111
114
112
115
- ## Building `Angular`
113
+ ## Building AngularJS
116
114
117
- To build `angular` , you check out the source code and use Rake to generate the non-minified and
118
- minified `angular` files:
115
+ To build AngularJS , you check out the source code and use Rake to generate the non-minified and
116
+ minified AngularJS files:
119
117
120
118
1. To clone your Github repository, run:
121
119
122
120
git clone
[email protected] :<github username>/angular.js.git
123
121
124
- 2. To go to the `angular` directory, run:
122
+ 2. To go to the AngularJS directory, run:
125
123
126
124
cd angular.js
127
125
128
- 3. To add the main `angular` repository as an upstream remote to your repository, run:
126
+ 3. To add the main AngularJS repository as an upstream remote to your repository, run:
129
127
130
128
git remote add upstream https://github.com/angular/angular.js.git
131
129
132
- 4. To build `angular` , run:
130
+ 4. To build AngularJS , run:
133
131
134
132
rake package
135
133
136
134
The build output can be located under the `build` directory. It consists of the following files and
137
135
directories:
138
136
139
- * `angular-<version>.tgz ` — This is the complete tarball , which contains all of the release build
137
+ * `angular-<version>.zip ` — This is the complete zip file , which contains all of the release build
140
138
artifacts.
141
139
142
140
* `angular.js` — The non-minified `angular` script.
@@ -145,69 +143,77 @@ artifacts.
145
143
146
144
* `angular-scenario.js` — The `angular` End2End test runner.
147
145
148
- * `angular-ie-compat.js` — The Internet Explorer compatibility patch file.
149
-
150
146
* `docs/` — A directory that contains all of the files needed to run `docs.angularjs.org`.
151
147
152
148
* `docs/index.html` — The main page for the documentation.
153
149
154
150
* `docs/docs-scenario.html` — The End2End test runner for the documentation application.
155
151
156
152
153
+ <a name="webserver"></a>
157
154
## Running a Local Development Web Server
158
155
159
- To debug or test code , it is often useful to have a local HTTP server. For this purpose, we have
156
+ To debug code and run end-to-end tests , it is often useful to have a local HTTP server. For this purpose, we have
160
157
made available a local web server based on Node.js.
161
158
162
159
1. To start the web server, run:
163
160
164
- ./nodeserver.sh
161
+ rake webserver
165
162
166
163
2. To access the local server, go to this website:
167
164
168
165
http://localhost:8000/
169
166
170
- By default, it serves the contents of the `angular` project directory.
167
+ By default, it serves the contents of the AngularJS project directory.
171
168
172
169
173
170
<a name="unit-tests"></a>
174
171
## Running the Unit Test Suite
175
172
176
- Our unit and integration tests are written with Jasmine and executed with JsTestDriver . To run the
177
- tests:
173
+ Our unit and integration tests are written with Jasmine and executed with Testacular . To run all of the
174
+ tests once on Chrome run :
178
175
179
- 1. To start the JSTD server, run:
176
+ rake test:unit
180
177
181
- ./server.sh
178
+ To run the tests on other browsers (Chrome, ChromeCanary, Firefox, Opera and Safari are pre-configured) use:
182
179
183
- 2. To capture one or more browsers, go to this website:
180
+ rake test:unit[Opera+Firefox]
181
+
182
+ During development it's however more productive to continuously run unit tests every time the source or test files
183
+ change. To execute tests in this mode run:
184
+
185
+ 1. To start the Testacular server, capture Chrome browser and run unit tests, run:
186
+
187
+ rake test:jqlite
188
+
189
+ 2. To capture more browsers, open this url in the desired browser (url might be different if you have multiple instance
190
+ of Testacular running, read Testacular's console output for the correct url):
184
191
185
192
http://localhost:9876/
186
193
187
- 3. To trigger a test execution, run:
194
+ 3. To re-run tests just change any source or test file.
188
195
189
- ./test.sh
190
196
191
- 4. To automatically run the test suite each time one or more of the files in the project directory
192
- is changed, you can install `watchr` and then run:
197
+ To learn more about all of the preconfigured Rake tasks run:
193
198
194
- watchr watchr.rb
199
+ rake -T
195
200
196
- 5. To view the output of each test run, you can tail this log file:
197
201
198
- ./logs/jstd.log
202
+ ## Running the end-to-end Test Suite
199
203
204
+ To run the E2E test suite:
200
205
201
- ## Running the End2End Test Suite
206
+ 1. Start the local web server if it's not running already.
202
207
203
- To run the End2End test suite:
208
+ rake webserver
204
209
205
- 1. Start the local web server.
206
210
2. In a browser, go to:
207
211
208
212
http://localhost:8000/build/docs/docs-scenario.html
209
213
210
- The tests are executed automatically.
214
+ or in terminal run:
215
+
216
+ rake test:e2e
211
217
212
218
213
219
0 commit comments