Skip to content

Commit

Permalink
console.debug is node v8 and above
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Beatty committed Oct 3, 2018
1 parent f85909d commit 833604d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs')
const path = require('path')

function log (message /*: string */) {
console.debug(`[dotenv][DEBUG] ${message}`)
console.log(`[dotenv][DEBUG] ${message}`)
}

/*
Expand Down
2 changes: 1 addition & 1 deletion tests/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ t.test('takes option for encoding', ct => {
t.test('takes option for debug', ct => {
ct.plan(1)

const logStub = sinon.stub(console, 'debug')
const logStub = sinon.stub(console, 'log')
dotenv.config({ debug: true })

ct.ok(logStub.called)
Expand Down
2 changes: 1 addition & 1 deletion tests/test-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const payload = dotenv.parse(Buffer.from('BASIC=basic'))
t.equal(payload.BASIC, 'basic', 'should parse a buffer from a file into an object')

// test debug path
const logStub = sinon.stub(console, 'debug')
const logStub = sinon.stub(console, 'log')
dotenv.parse(Buffer.from('what is this'), { debug: true })
t.ok(logStub.called)
logStub.restore()

0 comments on commit 833604d

Please sign in to comment.