UNPKG

jest-gwt

Version:

A small library to help Jest support given-when-then style testing without a bunch of overhead

34 lines 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var gwt_runner_1 = require("gwt-runner"); exports.default = (function (beforeEach, afterEach) { return (function (before, after) { beforeEach(function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: gwt_runner_1.TestContext.createContext(); return [4 /*yield*/, before.bind(gwt_runner_1.TestContext.context)()]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }); afterEach(function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: if (!after) return [3 /*break*/, 2]; return [4 /*yield*/, after.bind(gwt_runner_1.TestContext.context)()]; case 1: _a.sent(); _a.label = 2; case 2: gwt_runner_1.TestContext.releaseContext(); return [2 /*return*/]; } }); }); }); }); }); //# sourceMappingURL=withAspect.js.map