blob: ec222646d6bc9ab24911e3e719bbba9aeb52500e [file] [log] [blame]
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
shouldThrow(() => {
Promise.race.call(() => { }, []);
}, `TypeError: promise capability requires a constructor function`);