If you are using an AngularContext
, the default behavior is to automatically call .tick()
after each .flush()
and .error()
to trigger promise handlers and changed detection. This is the normal production behavior of asynchronous browser APIs. However, if zone.js does not patch the function you are stubbing, change detection would not run automatically. In that case you many want to turn off this behavior by passing the option autoTick: false
. See the list of functions that zone.js patches here.
Expect that no calls were made which match the given parameters or predicate. If a matching call was made, fail with a message including description
, if provided.
Optional
description: stringExpect that a single call was made that matches the given parameters or predicate, and return its mock. If no such call was made, or more than one, fail with a message including description
, if provided.
Optional
description: stringSearch for calls that match the given parameters or predicate, without any expectations.
Controller to be used in tests, that allows for mocking and flushing any asynchronous function. For example, to mock the browser's paste functionality: