UNPKG

folio

Version:

A customizable test framework to build your own test frameworks. Foundation for the [Playwright test runner](https://github.com/microsoft/playwright-test).

66 lines 2.13 kB
"use strict"; /** * Copyright Microsoft Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.RunnerTest = exports.RunnerSuite = exports.RunnerSpec = void 0; const test_1 = require("./test"); class RunnerSpec extends test_1.Spec { _allUsedParameters() { const result = new Set(this._usedParameters); this.parent._collectUsedParameters(result); return [...result]; } } exports.RunnerSpec = RunnerSpec; class RunnerSuite extends test_1.Suite { constructor() { super(...arguments); this._usedParameters = []; this._hooks = []; } _collectUsedParameters(result) { for (const param of this._usedParameters) result.add(param); if (this.parent) this.parent._collectUsedParameters(result); } _assignIds() { this.findSpec((test) => { for (const run of test.tests) run._id = `${test._ordinal}@${run.spec.file}::[${run._parametersString}]`; }); } _addHook(type, fn, stack) { this._hooks.push({ type, fn, stack }); } } exports.RunnerSuite = RunnerSuite; class RunnerTest extends test_1.Test { _appendTestResult() { const result = { retry: this.results.length, workerIndex: 0, duration: 0, stdout: [], stderr: [], data: {} }; this.results.push(result); return result; } } exports.RunnerTest = RunnerTest; //# sourceMappingURL=runnerTest.js.map