Skip to content

Commit cf16e52

Browse files
committed
docs: add table of contents to README
1 parent 9efe8c6 commit cf16e52

File tree

3 files changed

+386
-18
lines changed

3 files changed

+386
-18
lines changed

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,43 @@ This library makes RxJS Observables testing easy!
1919
</a>
2020
</div>
2121

22+
<br/>
23+
24+
# Table of Contents
25+
26+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
27+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
28+
29+
30+
- [Installation](#installation)
31+
- [The Problem](#the-problem-testing-rxjs-observables-is-hard-)
32+
- [The Solution](#the-solution-observer-spies-)
33+
- [Usage](#usage)
34+
- [`subscribeSpyTo(observable)`](#const-observerspy--subscribespytoobservable)
35+
- [`onComplete` (using `async` + `await`)](#wait-for-oncomplete-before-expecting-the-result-using-async--await)
36+
- [Spying on Errors (`expectErrors`)](#spy-on-errors-with-receivederror-and-geterror)
37+
- [Manually Creating Spies](#manually-using-new-observerspy)
38+
- [Auto Unsubscribing](#auto-unsubscribing)
39+
- [Testing Sync Logic](#testing-sync-logic)
40+
41+
- [Testing Async Logic](#testing-async-logic)
42+
- [▶ RxJS + Angular: use `fakeAsync`](#%E2%96%B6-rxjs---angular-use-fakeasync)
2243

44+
- [▶ RxJS + Promises: use `async` + `await`](#%E2%96%B6-rxjs--promises-use-async--await)
45+
46+
- [▶ RxJS Timers / Animations: use `fakeTime`](#%E2%96%B6-rxjs-timers--animations-use-faketime)
47+
- [▶ RxJS + _AJAX_ calls:](#%E2%96%B6-rxjs--_ajax_-calls)
48+
49+
50+
- [🧠 Wanna become a PRO Observables tester?](#-wanna-become-a-pro-observables-tester)
51+
- [How to Contribute](#contributing)
52+
- [Code Of Conduct](#code-of-conduct)
53+
- [Contributors ✨](#contributors-)
54+
- [License](#license)
55+
56+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
57+
58+
<br/>
2359

2460
## Installation
2561

@@ -366,9 +402,9 @@ it('should run synchronously', () => {
366402

367403
If you're **not using Angular** and have RxJS async operators like `delay` or `timeout`
368404

369-
Use `fakeTime` with `flush()` to simulate the passage of time ([detailed explanation](#-for-time-based-rxjs-code-timeouts--intervals--animations---use-faketime)) -
405+
Use `fakeTime` with `flush()` to simulate the passage of time ([detailed explanation](#-rxjs-timers--animations-use-faketime)) -
370406

371-
[![image](https://user-images.githubusercontent.com/210413/85336618-83f92180-b4a4-11ea-800d-6bb275eeda45.png)](#-for-time-based-rxjs-code-timeouts--intervals--animations---use-faketime)
407+
[![image](https://user-images.githubusercontent.com/210413/85336618-83f92180-b4a4-11ea-800d-6bb275eeda45.png)](#-rxjs-timers--animations-use-faketime)
372408

373409

374410
<br/>

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"commit": "git-cz",
1717
"compile": "tsc",
1818
"build": "run-s clean compile",
19+
"generate-toc": "doctoc README.md",
1920
"test": "jest",
2021
"test:watch": "jest --watch",
2122
"test:full": "run-s lint test",
@@ -58,6 +59,7 @@
5859
"all-contributors-cli": "6.16.0",
5960
"commitizen": "4.0.4",
6061
"cz-conventional-changelog": "3.1.0",
62+
"doctoc": "1.4.0",
6163
"husky": "4.2.5",
6264
"jest": "^25.4.0",
6365
"npm-run-all": "^4.1.5",

0 commit comments

Comments
 (0)