var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
export function run({ TIMEOUT, retrieveMetadata, runTests, reportResults, logger, cwd, }) {
    return __awaiter(this, void 0, void 0, function* () {
        const metadata = yield retrieveMetadata();
        yield logger.log('Running tests...');
        const start = performance.now();
        const results = yield runTests(TIMEOUT, metadata);
        const end = performance.now();
        const timeToRun = Math.round((end - start) * 100) / 100;
        yield logger.log(`Tests run in: ${timeToRun}ms`);
        yield reportResults(results, cwd);
    });
}
//# sourceMappingURL=runTestsAndReport.js.map