Guest User

Untitled

a guest
Jan 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. describe("describing", function() {
  2. it("", myWrapper(async function () {
  3. await new Promise((resolve, reject)=> {
  4. setTimeout(()=> reject(new Error('Test error!')), 1000)
  5. })
  6. }));
  7. });
  8.  
  9. function myWrapper(fn) {
  10. return async function() {
  11. try {
  12. await fn();
  13. } catch (err) {
  14. console.log('OMG DOING SOMETHING WITH ERROR')
  15. throw err
  16. }
  17. };
  18. }
Add Comment
Please, Sign In to add comment