You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(install+test): single cmd to full install/test & test JS w/o Dart
* `npm install` now does a full install; auxiliary installation steps
have been integrated into the `postinstall` script.
* Updated developer docs `DEVELOPER.md` accordingly; also added
instructions to dev docs for performing full tests (via `npm test`) --
same as those run on Travis.
* Reorg in tests so that JS tests can run without a Dart env.
Partly fixesangular#945 **under the assumption that when running JS tests
locally, `ChromeCanary` is the desired browser to use**. Note that CI
tests (Travis) still uses `DartiumWithWebPlatform` across the board
(Maybe because ChromeCanary isn't being installed?)
Fixesangular#1012.
Closesangular#1010
**Optional**: In this document, we make use of project local `npm` package scripts and binaries
107
101
(stored under `./node_modules/.bin`) by prefixing these command invocations with `$(npm bin)`; in
108
-
particular `gulp` and `protractor` commands. If you prefer, you can drop this path prefix by
109
-
globally installing these two packages as follows:
102
+
particular `gulp` and `protractor` commands. If you prefer, you can drop this path prefix by either:
103
+
104
+
*Option 1*: globally installing these two packages as follows:
110
105
111
106
*`npm install -g gulp` (you might need to prefix this command with `sudo`)
112
107
*`npm install -g protractor` (you might need to prefix this command with `sudo`)
113
108
114
-
Since global installs can become stale, we avoid their use in these instructions.
109
+
Since global installs can become stale, and required versions can vary by project, we avoid their
110
+
use in these instructions.
111
+
112
+
*Option 2*: defining a bash alias like `alias nbin='PATH=$(npm bin):$PATH'` as detailed in this
113
+
[Stackoverflow answer](http://stackoverflow.com/questions/9679932/how-to-use-package-installed-locally-in-node-modules/15157360#15157360) and used like this: e.g., `nbin gulp build`.
115
114
116
115
## Build commands
117
116
@@ -133,22 +132,35 @@ $(npm bin)/gulp clean
133
132
134
133
## Running Tests Locally
135
134
136
-
### Basic tests
135
+
### Full test suite
136
+
137
+
*`npm test`: full test suite for both JS and Dart versions of Angular. These are the same tests as
138
+
those run on Travis.
137
139
138
-
1.`$(npm bin)/gulp test.unit.js`: JS tests in a browser; runs in **watch mode** (i.e. karma
139
-
watches the test files for changes and re-runs tests when files are updated).
140
-
2.`$(npm bin)/gulp test.unit.cjs`: JS tests in NodeJS; runs in **watch mode**
141
-
3.`$(npm bin)/gulp test.unit.dart`: Dart tests in Dartium; runs in **watch mode**.
140
+
You can selectively run either the JS or Dart versions as follows:
141
+
142
+
*`$(npm bin)/gulp test.all.js`
143
+
*`$(npm bin)/gulp test.all.dart`
144
+
145
+
### Unit tests
146
+
147
+
You can run just the unit tests as follows:
148
+
149
+
*`$(npm bin)/gulp test.unit.js`: JS tests in a browser; runs in **watch mode** (i.e. karma
150
+
watches the test files for changes and re-runs tests when files are updated).
151
+
*`$(npm bin)/gulp test.unit.cjs`: JS tests in NodeJS; runs in **watch mode**.
152
+
*`$(npm bin)/gulp test.unit.dart`: Dart tests in Dartium; runs in **watch mode**.
142
153
143
154
If you prefer running tests in "single-run" mode rather than watch mode use
144
155
145
156
*`$(npm bin)/gulp test.unit.js/ci`
157
+
*`$(npm bin)/gulp test.unit.cjs/ci`
146
158
*`$(npm bin)/gulp test.unit.dart/ci`
147
159
148
-
**Note**: If you want to only run a single test you can alter the test you wish
149
-
to run by changing `it` to `iit` or `describe` to `ddescribe`. This will only
150
-
run that individual test and make it much easier to debug. `xit` and `xdescribe`
151
-
can also be useful to exclude a test and a group of tests respectively.
160
+
**Note**: If you want to only run a single test you can alter the test you wish to run by changing
161
+
`it` to `iit` or `describe` to `ddescribe`. This will only run that individual test and make it
162
+
much easier to debug. `xit` and `xdescribe` can also be useful to exclude a test and a group of
163
+
tests respectively.
152
164
153
165
**Note** for transpiler tests: The karma preprocessor is setup in a way so that after every test
154
166
run the transpiler is reloaded. With that it is possible to make changes to the preprocessor and
@@ -232,4 +244,3 @@ on the `debugger;` statement.
232
244
You can then step into the code and add watches.
233
245
The `debugger;` statement is needed because WebStorm will stop in a transpiled file. Breakpoints in
234
246
the original source files are not supported at the moment.
0 commit comments