Skip to content

Instantly share code, notes, and snippets.

@alex-okrushko
Created October 2, 2018 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-okrushko/663b1183e938167ba009ee21b8d8496c to your computer and use it in GitHub Desktop.
Save alex-okrushko/663b1183e938167ba009ee21b8d8496c to your computer and use it in GitHub Desktop.
it("should handle a basic source that emits next then errors, count=3", () => {
testScheduler.run(({ expectObservable, cold, expectSubscriptions }) => {
const source = cold("--1-2-3-#");
const subs = [ "^ ! ",
" ^ ! ",
" ^ !"
];
const expected = "--1-2-3----1-2-3-----1-2-3-#";
expectObservable(
source.pipe(retryBackoff({ initialInterval: 1, maxAttempts: 3 }))
).toBe(expected);
expectSubscriptions(source.subscriptions).toBe(subs);
});
});
// FAILS with
AssertionError: expected [ Array(3) ] to deeply equal [ Array(3) ]
+ expected - actual
[
{
"subscribedFrame": 0
- "unsubscribedFrame": 8
+ "unsubscribedFrame": 1
}
{
- "subscribedFrame": 9
- "unsubscribedFrame": 17
+ "subscribedFrame": 0
+ "unsubscribedFrame": 1
}
{
- "subscribedFrame": 19
- "unsubscribedFrame": 27
+ "subscribedFrame": 0
+ "unsubscribedFrame": 1
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment