Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 84a1e7d

Browse files
committed
add testing
1 parent 43bf280 commit 84a1e7d

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

public/docs/ts/latest/cookbook/third-party-lib.jade

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,33 @@ code-example(language="json").
252252

253253
.l-main-section
254254
:marked
255-
## Testing
255+
## Testing libraries
256256

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`.
258282

259283
.l-main-section
260284
:marked

0 commit comments

Comments
 (0)