Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("describing", function() {
- it("", myWrapper(async function () {
- await new Promise((resolve, reject)=> {
- setTimeout(()=> reject(new Error('Test error!')), 1000)
- })
- }));
- });
- function myWrapper(fn) {
- return async function() {
- try {
- await fn();
- } catch (err) {
- console.log('OMG DOING SOMETHING WITH ERROR')
- throw err
- }
- };
- }
Add Comment
Please, Sign In to add comment