MCPcopy
hub / github.com/codeceptjs/CodeceptJS / deleteDir

Function deleteDir

lib/utils.js:334–346  ·  view source on GitHub ↗
(dir_path)

Source from the content-addressed store, hash-verified

332}
333
334export const deleteDir = function (dir_path) {
335 if (fs.existsSync(dir_path)) {
336 fs.readdirSync(dir_path).forEach(function (entry) {
337 const entry_path = path.join(dir_path, entry)
338 if (fs.lstatSync(entry_path).isDirectory()) {
339 deleteDir(entry_path)
340 } else {
341 fs.unlinkSync(entry_path)
342 }
343 })
344 fs.rmdirSync(dir_path)
345 }
346}
347
348/**
349 * Returns absolute filename to save screenshot.

Callers 4

aiTrace.jsFile · 0.90
wireSlidesFunction · 0.90
Playwright_test.jsFile · 0.90
Puppeteer_test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected