unit test for promise rejection. close #51.