MCPcopy
hub / github.com/cucumber/cucumber-js / buildSupportCodeLibrary

Function buildSupportCodeLibrary

test/runtime_helpers.ts:25–39  ·  view source on GitHub ↗
(
  cwd: string | DefineSupportCodeFunction = __dirname,
  fn: DefineSupportCodeFunction = null
)

Source from the content-addressed store, hash-verified

23type DefineSupportCodeFunction = (methods: IDefineSupportCodeMethods) => void
24
25export function buildSupportCodeLibrary(
26 cwd: string | DefineSupportCodeFunction = __dirname,
27 fn: DefineSupportCodeFunction = null
28): SupportCodeLibrary {
29 if (typeof cwd === 'function') {
30 fn = cwd
31 cwd = __dirname
32 }
33 const supportCodeLibraryBuilder = new SupportCodeLibraryBuilder()
34 supportCodeLibraryBuilder.reset(cwd, IdGenerator.incrementing())
35 if (doesHaveValue(fn)) {
36 fn(supportCodeLibraryBuilder.methods)
37 }
38 return supportCodeLibraryBuilder.finalize()
39}

Calls 4

resetMethod · 0.95
finalizeMethod · 0.95
doesHaveValueFunction · 0.90
fnFunction · 0.50

Tested by

no test coverage detected