babel-plugin-tester
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -93,66 +93,30 @@ 'use strict'; | ||
var testerWrapper = function () { | ||
var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee() { | ||
var teardowns, returnedTeardown; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
teardowns = teardown ? [teardown] : []; | ||
returnedTeardown = void 0; | ||
_context.prev = 2; | ||
_context.next = 5; | ||
return setup(); | ||
case 5: | ||
returnedTeardown = _context.sent; | ||
_context.next = 12; | ||
break; | ||
case 8: | ||
_context.prev = 8; | ||
_context.t0 = _context['catch'](2); | ||
// eslint-disable-next-line no-console | ||
console.error('There was a problem during setup'); | ||
throw _context.t0; | ||
case 12: | ||
if (typeof returnedTeardown === 'function') { | ||
teardowns.push(returnedTeardown); | ||
} | ||
_context.prev = 13; | ||
tester(); | ||
case 15: | ||
_context.prev = 15; | ||
_context.prev = 16; | ||
_context.next = 19; | ||
return Promise.all(teardowns.map(function (t) { | ||
return t(); | ||
})); | ||
case 19: | ||
_context.next = 25; | ||
break; | ||
case 21: | ||
_context.prev = 21; | ||
_context.t1 = _context['catch'](16); | ||
// eslint-disable-next-line no-console | ||
console.error('There was a problem during teardown'); | ||
// eslint-disable-next-line no-unsafe-finally | ||
throw _context.t1; | ||
case 25: | ||
return _context.finish(15); | ||
case 26: | ||
case 'end': | ||
return _context.stop(); | ||
} | ||
var _ref2 = _asyncToGenerator(function* () { | ||
var teardowns = teardown ? [teardown] : []; | ||
var returnedTeardown = void 0; | ||
try { | ||
returnedTeardown = yield setup(); | ||
} catch (e) { | ||
// eslint-disable-next-line no-console | ||
console.error('There was a problem during setup'); | ||
throw e; | ||
} | ||
if (typeof returnedTeardown === 'function') { | ||
teardowns.push(returnedTeardown); | ||
} | ||
try { | ||
tester(); | ||
} finally { | ||
try { | ||
yield Promise.all(teardowns.map(function (t) { | ||
return t(); | ||
})); | ||
} catch (e) { | ||
// eslint-disable-next-line no-console | ||
console.error('There was a problem during teardown'); | ||
// eslint-disable-next-line no-unsafe-finally | ||
throw e; | ||
} | ||
}, _callee, this, [[2, 8], [13,, 15, 26], [16, 21]]); | ||
})); | ||
} | ||
}); | ||
@@ -159,0 +123,0 @@ return function testerWrapper() { |
{ | ||
"name": "babel-plugin-tester", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "Utilities for testing babel plugins", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31680
292