Function resolvesNext
- resolves
Next <Return, Self, Args>(iterable): ((this: Self, ...args: Args) => Promise<Return>) Type Parameters
Parameters
Returns ((this: Self, ...args: Args) => Promise<Return>)
A function that resolves the awaited iterable values
Example: Usage
import { resolvesNext } from "@std/testing/mock";
import { assertEquals, assertRejects } from "@std/assert";
const func = resolvesNext([1, 2, new Error("foo"), 3]);
assertEquals(await func(), 1);
assertEquals(await func(), 2);
assertRejects(() => func(), Error, "foo");
assertEquals(await func(), 3);
Creates a function that resolves the awaited iterable values. Any awaited iterable values that are errors will be thrown.