Skip to content

Commit

Permalink
fix tests on node 12
Browse files Browse the repository at this point in the history
  • Loading branch information
andreialecu committed Aug 6, 2020
1 parent 5b3aaa4 commit ac20ff8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test-config-cli.js
Expand Up @@ -5,6 +5,8 @@ const path = require('path')

const t = require('tap')

const configPath = path.resolve(__dirname, '../config.js')

function spawn (cmd, options = {}) {
const { stdout } = cp.spawnSync(
process.argv[0], // node binary
Expand All @@ -29,7 +31,7 @@ t.plan(3)
t.equal(
spawn([
'-r',
'../config',
configPath,
'-e',
'console.log(process.env.BASIC)',
'dotenv_config_encoding=utf8',
Expand All @@ -40,7 +42,7 @@ t.equal(

// dotenv/config supports configuration via environment variables
t.equal(
spawn(['-r', '../config', '-e', 'console.log(process.env.BASIC)'], {
spawn(['-r', configPath, '-e', 'console.log(process.env.BASIC)'], {
env: {
DOTENV_CONFIG_PATH: './tests/.env'
}
Expand All @@ -53,7 +55,7 @@ t.equal(
spawn(
[
'-r',
'../config',
configPath,
'-e',
'console.log(process.env.BASIC)',
'dotenv_config_path=./tests/.env'
Expand Down

0 comments on commit ac20ff8

Please sign in to comment.