fix: return path from netLog.stopLogging (#21988)

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
This commit is contained in:
trop[bot]
2020-01-31 11:21:52 -08:00
committed by GitHub
parent 538ebabf7e
commit 77448c75c6
2 changed files with 4 additions and 2 deletions

View File

@@ -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')

View File

@@ -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()
})