Test for throwing a promise