This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
public/docs/ts/latest/cookbook Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -252,9 +252,33 @@ code-example(language="json").
252
252
253
253
.l-main-section
254
254
:marked
255
- ## Testing
255
+ ## Testing libraries
256
256
257
- content
257
+ While testing is always important, it's **especially** important in libraries because consumer
258
+ applications might break due to bugs in libraries.
259
+
260
+ But the fact that a library is consumed by another application is also what makes it hard to test.
261
+
262
+ To properly test a library, you need to have an integration test.
263
+ An integration test is to libraries what a end-to-end test is to applications.
264
+ It tests how an app would install and use your library.
265
+
266
+ The **QuickStart Library seed** includes a directory called `integration` containing a standalone
267
+ app that consumes your built library in both JIT and AOT modes, with end-to-end tests to verify
268
+ it works.
269
+
270
+ To run the integration tests, do `npm run integration` which does the following:
271
+ - Build your library.
272
+ - Enter the integration app's directory.
273
+ - Install dependencies.
274
+ - Test the app in JIT mode.
275
+ - Build the app in AOT mode.
276
+ - Test the app in AOT mode.
277
+
278
+ Running integration tests gives you greater confidence that your library is properly built.
279
+
280
+ In addition to integration tests, you can also run unit tests in watch mode via `npm run test`,
281
+ or single-run via `npm run test:once`.
258
282
259
283
.l-main-section
260
284
:marked
You can’t perform that action at this time.
0 commit comments