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

Method setupFileWatcher

lib/test-server.js:267–276  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265 }
266
267 setupFileWatcher() {
268 if (fs.existsSync(this.dbFile)) {
269 fs.watchFile(this.dbFile, (current, previous) => {
270 if (current.mtime !== previous.mtime) {
271 console.log('Database file changed, reloading data...')
272 this.reloadData()
273 }
274 })
275 }
276 }
277
278 start() {
279 return new Promise((resolve, reject) => {

Callers 1

constructorMethod · 0.95

Calls 2

reloadDataMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected