Lines Matching refs:promiseFn
773 async function waitForActual(promiseFn) {
775 if (typeof promiseFn === 'function') {
776 // Return a rejected promise if `promiseFn` throws synchronously.
777 resultPromise = promiseFn();
781 'promiseFn', resultPromise);
783 } else if (checkIsPromise(promiseFn)) {
784 resultPromise = promiseFn;
787 'promiseFn', ['Function', 'Promise'], promiseFn);
896 * Expects the function `promiseFn` to throw an error.
897 * @param {() => any} promiseFn
901 assert.throws = function throws(promiseFn, ...args) {
902 expectsError(throws, getActual(promiseFn), ...args);
906 * Expects `promiseFn` function or its value to reject.
907 * @param {() => Promise<any>} promiseFn
911 assert.rejects = async function rejects(promiseFn, ...args) {
912 expectsError(rejects, await waitForActual(promiseFn), ...args);