MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / unlink

Function unlink

javascript/selenium-webdriver/io/index.js:164–175  ·  view source on GitHub ↗

* Deletes a name from the filesystem and possibly the file it refers to. Has * no effect if the file does not exist. * @param {string} aPath The path to remove. * @return {!Promise} A promise for when the file has been removed.

(aPath)

Source from the content-addressed store, hash-verified

162 * @return {!Promise} A promise for when the file has been removed.
163 */
164function unlink(aPath) {
165 return new Promise(function (fulfill, reject) {
166 const exists = fs.existsSync(aPath)
167 if (exists) {
168 fs.unlink(aPath, function (err) {
169 ;(err && reject(err)) || fulfill()
170 })
171 } else {
172 fulfill()
173 }
174 })
175}
176
177/**
178 * @return {!Promise<string>} A promise for the path to a temporary directory.

Callers

nothing calls this directly

Calls 1

rejectFunction · 0.85

Tested by

no test coverage detected