MCPcopy Create free account
hub / github.com/denoland/std / addStep

Method addStep

testing/_test_suite.ts:301–320  ·  view source on GitHub ↗

This is used internally to add steps to a test suite.

(
    suite: TestSuiteInternal<T>,
    step: TestSuiteInternal<T> | ItDefinition<T>,
  )

Source from the content-addressed store, hash-verified

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>(

Callers 2

itFunction · 0.80
constructorMethod · 0.80

Calls 2

addingOnlyStepMethod · 0.80
pushMethod · 0.45

Tested by 1

itFunction · 0.64