Skip to content

Commit 21322d0

Browse files
committed
docs(readme): clean up the .expectErors() doc
1 parent f7dc6c1 commit 21322d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,12 @@ it('should spy on Observable errors', () => {
341341
const fakeObservable = throwError('OOPS');
342342

343343
const observerSpy = new ObserverSpy({expectErrors: true}); // <-- IMPORTANT
344+
// OR
345+
const observerSpy = new ObserverSpy().expectErrors(); // <-- ALTERNATIVE WAY TO SET IT
344346

345-
// BTW, this could also be set like this:
347+
// Or even...
346348
observerSpy.expectErrors(); // <-- ALTERNATIVE WAY TO SET IT
347-
// or even like this:
348-
observerSpy = new ObserverSpy().expectErrors(); // <-- ALTERNATIVE WAY TO SET IT
349-
349+
350350
fakeObservable.subscribe(observerSpy);
351351

352352
expect(observerSpy.receivedError()).toBe(true);

0 commit comments

Comments
 (0)