* * @param {string} _name * @param {object} variant * @param {BrowserNameDef} browserName
(_name, variant, browserName)
| 457 | * @param {BrowserNameDef} browserName |
| 458 | */ |
| 459 | function doTemplate(_name, variant, browserName) { |
| 460 | const env = Object.create(variant); |
| 461 | // @ts-ignore |
| 462 | this.timeout(TEST_TIMEOUT); |
| 463 | beforeEach(async function () { |
| 464 | this.timeout(SETUP_TIMEOUT); |
| 465 | configureHelpers(env); |
| 466 | await fixture.setup(env, browserName, SETUP_RETRIES); |
| 467 | |
| 468 | // don't install for CI |
| 469 | if (!isCiBuild()) { |
| 470 | installRepl(global, env); |
| 471 | } |
| 472 | }); |
| 473 | |
| 474 | afterEach(async function () { |
| 475 | if (argv.coverage) { |
| 476 | await updateCoverage(env); |
| 477 | } |
| 478 | |
| 479 | // If there is an async expect error, throw it in the final state. |
| 480 | const lastExpectError = getLastExpectError(); |
| 481 | if (lastExpectError) { |
| 482 | /** @type {any} */ (this.test).error(lastExpectError); |
| 483 | clearLastExpectError(); |
| 484 | } |
| 485 | |
| 486 | await fixture.teardown(env); |
| 487 | for (const key in env) { |
| 488 | delete env[key]; |
| 489 | } |
| 490 | |
| 491 | if (!isCiBuild()) { |
| 492 | uninstallRepl(); |
| 493 | } |
| 494 | }); |
| 495 | |
| 496 | after(async () => { |
| 497 | if (argv.coverage) { |
| 498 | await reportCoverage(); |
| 499 | } |
| 500 | }); |
| 501 | |
| 502 | describe(SUB, function () { |
| 503 | fn.call(this, env); |
| 504 | }); |
| 505 | } |
| 506 | }; |
| 507 | |
| 508 | /** |
nothing calls this directly
no test coverage detected