MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / docsExternalHelpers

Function docsExternalHelpers

Bunoshfile.js:123–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121 * Generate documentation for helpers that live outside of the main repo (Detox, MockRequest).
122 */
123export async function docsExternalHelpers() {
124 task.stopOnFailures()
125 say('Building @codecepjs/detox helper docs')
126 let helper = 'Detox'
127 replaceInFile(`node_modules/@codeceptjs/detox-helper/${helper}.js`, cfg => {
128 cfg.replace(/CodeceptJS.LocatorOrString/g, 'string | object')
129 cfg.replace(/LocatorOrString/g, 'string | object')
130 })
131 await shell`npx documentation build node_modules/@codeceptjs/detox-helper/${helper}.js -o ${helperMarkDownFile(helper)} ${documentjsCliArgs}`
132
133 await writeToFile(helperMarkDownFile(helper), line => {
134 line`---\npermalink: /helpers/${helper}\nsidebar: auto\ntitle: ${helper}\n---\n\n# ${helper}\n\n`
135 line.fromFile(helperMarkDownFile(helper))
136 })
137
138 replaceInFile(`node_modules/@codeceptjs/detox-helper/${helper}.js`, cfg => {
139 cfg.replace(/string \| object/g, 'CodeceptJS.LocatorOrString')
140 cfg.replace(/string \| object/g, 'LocatorOrString')
141 })
142
143 await writeToFile(helperMarkDownFile(helper), line => {
144 line`---\npermalink: /helpers/${helper}\nsidebar: auto\ntitle: ${helper}\n---\n\n# ${helper}\n\n`
145 line.fromFile(helperMarkDownFile(helper))
146 })
147
148 replaceInFile('node_modules/@codeceptjs/mock-request/index.js', cfg => {
149 cfg.replace(/string \| object/g, 'CodeceptJS.LocatorOrString')
150 cfg.replace(/string \| object/g, 'LocatorOrString')
151 })
152}
153
154/**
155 * Generate documentation for the externally hosted Vue plugin.

Callers 2

docsFunction · 0.70
defFunction · 0.70

Calls 3

sayFunction · 0.85
replaceInFileFunction · 0.85
helperMarkDownFileFunction · 0.70

Tested by

no test coverage detected