"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultTestRunner = exports.TestRunner = void 0;
const tracing_1 = __importStar(require("../../Tracing"));
const fileName_1 = "(@effect-ts/system): _src/Testing/TestRunner/index.ts";
const Clock = __importStar(require("../../Clock"));
const T = __importStar(require("../../Effect"));
const Function_1 = require("../../Function");
const L = __importStar(require("../../Layer"));
const Annotations = __importStar(require("../Annotations"));
const TestAnnotationRenderer = __importStar(require("../TestAnnotationRenderer"));
const TestClock_1 = require("../TestClock");
const TestExecutor_1 = require("../TestExecutor");
const TestLogger_1 = require("../TestLogger");
const TestReporter_1 = require("../TestReporter");
const defaultClock = L.fromFunction(Clock.HasClock)(() => new Clock.LiveClock());
const defaultLayer = defaultClock["+++"](TestLogger_1.FromConsole);
class TestRunner {
    constructor(executor, platform = T.defaultPlatform, reporter = (0, TestReporter_1.DefaultTestReporter)(TestAnnotationRenderer.standard), bootstrap = defaultLayer) {
        this.executor = executor;
        this.platform = platform;
        this.reporter = reporter;
        this.bootstrap = bootstrap;
        this.runtime = new T.CustomRuntime(undefined, this.platform);
        this.run = (spec) => (T.chain_(T.timed(this.executor.run(spec, T.parallelN(4)), fileName_1 + ":38:14"), ({ tuple: [d, e] }) => T.as_(this.reporter((0, TestClock_1.Duration)(d), e), e, fileName_1 + ":39:43"), fileName_1 + ":39:14"));
    }
}
exports.TestRunner = TestRunner;
exports.defaultTestRunner = new TestRunner((0, TestExecutor_1.defaultExecutor)(Annotations.live["+++"](L.succeed(T.defaultEnv))));
//# sourceMappingURL=index.js.map