mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: return path from netLog.stopLogging (#21988)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
This commit is contained in:
@@ -36,8 +36,9 @@ NetLog.prototype.startLogging = function (path, ...args) {
|
||||
|
||||
const _originalStopLogging = NetLog.prototype.stopLogging
|
||||
NetLog.prototype.stopLogging = function () {
|
||||
const logPath = this._currentlyLoggingPath
|
||||
this._currentlyLoggingPath = null
|
||||
return _originalStopLogging.call(this)
|
||||
return _originalStopLogging.call(this).then(() => logPath)
|
||||
}
|
||||
|
||||
const currentlyLoggingPathDeprecated = deprecate.warnOnce('currentlyLoggingPath')
|
||||
|
||||
@@ -70,7 +70,8 @@ describe('netLog module', () => {
|
||||
|
||||
expect(testNetLog().currentlyLoggingPath).to.equal(dumpFileDynamic)
|
||||
|
||||
await testNetLog().stopLogging()
|
||||
const path = await testNetLog().stopLogging()
|
||||
expect(path).to.equal(dumpFileDynamic)
|
||||
|
||||
expect(fs.existsSync(dumpFileDynamic)).to.be.true()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user