зеркало из https://github.com/electron/electron.git
fix: return path from netLog.stopLogging (#21985)
This commit is contained in:
Родитель
a58bc42ed0
Коммит
1c6d8f5af6
|
@ -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')
|
||||
|
|
|
@ -71,7 +71,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('currently logging')
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче