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
We have no intention of updating the source on `angular/quickstart`.
36
-
Discard everything "git-like" by deleting the `.git` folder.
37
-
```bash
38
-
rm -rf .git // non-Windows
39
-
rd .git /S/Q // windows
40
-
```
41
-
42
-
### Create a new git repo
43
-
You could [start writing code](#start-development) now and throw it all away when you're done.
44
-
If you'd rather preserve your work under source control, consider taking the following steps.
45
-
46
-
Initialize this project as a *local git repo* and make the first commit:
47
-
```bash
48
-
git init
49
-
git add .
50
-
git commit -m "Initial commit"
51
-
```
52
-
53
-
Create a *remote repository* for this project on the service of your choice.
54
-
55
-
Grab its address (e.g. *`https://github.com/<my-org>/my-proj.git`*) and push the *local repo* to the *remote*.
56
-
```bash
57
-
git remote add origin <repo-address>
58
-
git push -u origin master
59
-
```
60
9
## Install npm packages
61
10
62
-
> See npm and nvm version notes above
63
-
64
11
Install the npm packages described in the `package.json` and verify that it works:
65
12
66
13
**Attention Windows Developers: You must run all of these commands in administrator mode**.
@@ -80,11 +27,9 @@ Both the compiler and the server watch for file changes.
80
27
81
28
Shut it down manually with Ctrl-C.
82
29
83
-
You're ready to write your application.
84
-
85
30
### npm scripts
86
31
87
-
We've captured many of the most useful commands in npm scripts defined in the `package.json`:
32
+
Useful commands in npm scripts defined in the `package.json`:
88
33
89
34
*`npm start` - runs the compiler and a server at the same time, both in "watch mode".
90
35
*`npm run tsc` - runs the TypeScript compiler once.
@@ -97,22 +42,12 @@ with excellent support for Angular apps that use routing.
97
42
*`npm run postinstall` - called by *npm* automatically *after* it successfully completes package installation. This script installs the TypeScript definition files this app requires.
98
43
Here are the test related scripts:
99
44
*`npm test` - compiles, runs and watches the karma unit tests
100
-
*`npm run e2e` - run protractor e2e tests, written in JavaScript (*e2e-spec.js)
101
-
102
-
## Testing
103
-
104
-
The QuickStart documentation doesn't discuss testing.
105
-
This repo adds both karma/jasmine unit test and protractor end-to-end testing support.
106
-
107
-
These tools are configured for specific conventions described below.
108
-
109
-
*It is unwise and rarely possible to run the application, the unit tests, and the e2e tests at the same time.
110
-
We recommend that you shut down one before starting another.*
45
+
*`npm run e2e` - run protractor e2e tests, written in JavaScript (*e2e-spec.js)[*make sure lite server is running for the e2e to work.]
111
46
112
47
### Unit Tests
113
48
TypeScript unit-tests are usually in the `app` folder. Their filenames must end in `.spec`.
114
49
115
-
Look for the example `app/app.component.spec.ts`.
50
+
Look for the example `app/components/app.component.spec.ts`.
116
51
Add more `.spec.ts` files as you wish; we configured karma to find them.
117
52
118
53
Run it with `npm test`
@@ -122,29 +57,18 @@ Both the compiler and the karma watch for (different) file changes.
122
57
123
58
Shut it down manually with Ctrl-C.
124
59
125
-
Test-runner output appears in the terminal window.
126
-
We can update our app and our tests in real-time, keeping a weather eye on the console for broken tests.
127
-
Karma is occasionally confused and it is often necessary to shut down its browser or even shut the command down (Ctrl-C) and
128
-
restart it. No worries; it's pretty quick.
129
-
130
-
The `HTML-Reporter` is also wired in. That produces a prettier output; look for it in `~_test-output/tests.html`.
131
-
132
60
### End-to-end (E2E) Tests
133
61
134
62
E2E tests are in the `e2e` directory, side by side with the `app` folder.
135
63
Their filenames must end in `.e2e-spec.ts`.
136
64
137
65
Look for the example `e2e/app.e2e-spec.ts`.
138
66
Add more `.e2e-spec.js` files as you wish (although one usually suffices for small projects);
139
-
we configured protractor to find them.
67
+
protractor is configured to find them.
140
68
141
69
Thereafter, run them with `npm run e2e`.
142
70
143
-
That command first compiles, then simultaneously starts the Http-Server at `localhost:8080`
71
+
That command first compiles, then simultaneously starts the Http-Server at `localhost:3000`
144
72
and launches protractor.
145
73
146
-
The pass/fail test results appear at the bottom of the terminal window.
147
-
A custom reporter (see `protractor.config.js`) generates a `./_test-output/protractor-results.txt` file
148
-
which is easier to read; this file is excluded from source control.
0 commit comments