This is used internally to add steps to a test suite.
(
suite: TestSuiteInternal<T>,
step: TestSuiteInternal<T> | ItDefinition<T>,
)
| 299 | |
| 300 | /** This is used internally to add steps to a test suite. */ |
| 301 | static addStep<T>( |
| 302 | suite: TestSuiteInternal<T>, |
| 303 | step: TestSuiteInternal<T> | ItDefinition<T>, |
| 304 | ) { |
| 305 | if (!suite.hasOnlyStep) { |
| 306 | if (step instanceof TestSuiteInternal) { |
| 307 | if (step.hasOnlyStep || step.describe.only) { |
| 308 | TestSuiteInternal.addingOnlyStep(suite); |
| 309 | } |
| 310 | } else { |
| 311 | if (step.only) TestSuiteInternal.addingOnlyStep(suite); |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | if ( |
| 316 | !(suite.hasOnlyStep && !(step instanceof TestSuiteInternal) && !step.only) |
| 317 | ) { |
| 318 | suite.steps.push(step); |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | /** This is used internally to add hooks to a test suite. */ |
| 323 | static setHook<T>( |