(runablesToRun)
| 7918 | // synchronously from Env#execute. |
| 7919 | // TODO: make this and Env#execute async in the next major release |
| 7920 | execute(runablesToRun) { |
| 7921 | if (this.executedBefore_) { |
| 7922 | this.topSuite_.reset() |
| 7923 | } |
| 7924 | this.executedBefore_ = true |
| 7925 | |
| 7926 | this.hasFailures = false |
| 7927 | const focusedRunables = this.focusedRunables_() |
| 7928 | const config = this.getConfig_() |
| 7929 | |
| 7930 | if (!runablesToRun) { |
| 7931 | if (focusedRunables.length) { |
| 7932 | runablesToRun = focusedRunables |
| 7933 | } else { |
| 7934 | runablesToRun = [this.topSuite_.id] |
| 7935 | } |
| 7936 | } |
| 7937 | |
| 7938 | const order = new j$.Order({ |
| 7939 | random: config.random, |
| 7940 | seed: j$.isNumber_(config.seed) ? config.seed + "" : config.seed, |
| 7941 | }) |
| 7942 | |
| 7943 | const processor = new j$.TreeProcessor({ |
| 7944 | tree: this.topSuite_, |
| 7945 | runnableIds: runablesToRun, |
| 7946 | queueRunnerFactory: (options) => { |
| 7947 | if (options.isLeaf) { |
| 7948 | // A spec |
| 7949 | options.SkipPolicy = j$.CompleteOnFirstErrorSkipPolicy |
| 7950 | } else { |
| 7951 | // A suite |
| 7952 | if (config.stopOnSpecFailure) { |
| 7953 | options.SkipPolicy = j$.CompleteOnFirstErrorSkipPolicy |
| 7954 | } else { |
| 7955 | options.SkipPolicy = j$.SkipAfterBeforeAllErrorPolicy |
| 7956 | } |
| 7957 | } |
| 7958 | |
| 7959 | return this.queueRunnerFactory_(options) |
| 7960 | }, |
| 7961 | failSpecWithNoExpectations: config.failSpecWithNoExpectations, |
| 7962 | nodeStart: (suite, next) => { |
| 7963 | this.currentlyExecutingSuites_.push(suite) |
| 7964 | this.runableResources_.initForRunable(suite.id, suite.parentSuite.id) |
| 7965 | this.reporter_.suiteStarted(suite.result).then(next) |
| 7966 | suite.startTimer() |
| 7967 | }, |
| 7968 | nodeComplete: (suite, result, next) => { |
| 7969 | if (suite !== this.currentSuite()) { |
| 7970 | throw new Error("Tried to complete the wrong suite") |
| 7971 | } |
| 7972 | |
| 7973 | this.runableResources_.clearForRunable(suite.id) |
| 7974 | this.currentlyExecutingSuites_.pop() |
| 7975 | |
| 7976 | if (result.status === "failed") { |
| 7977 | this.hasFailures = true |
no test coverage detected