Skip to content

Commit

Permalink
Fix failing tests from 12.16.0 and newer
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed May 5, 2021
1 parent ceae177 commit 8f04b9d
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions tests/test-config-cli.js
Expand Up @@ -27,24 +27,34 @@ t.plan(3)

// dotenv/config enables preloading
t.equal(
spawn([
'-r',
'../config',
'-e',
'console.log(process.env.BASIC)',
'dotenv_config_encoding=utf8',
'dotenv_config_path=./tests/.env'
]),
spawn(
[
'-r',
path.resolve(__dirname, '../config'),
'-e',
'console.log(process.env.BASIC)',
'dotenv_config_encoding=utf8',
'dotenv_config_path=./tests/.env'
]
),
'basic\n'
)

// dotenv/config supports configuration via environment variables
t.equal(
spawn(['-r', '../config', '-e', 'console.log(process.env.BASIC)'], {
env: {
DOTENV_CONFIG_PATH: './tests/.env'
spawn(
[
'-r',
path.resolve(__dirname, '../config'),
'-e',
'console.log(process.env.BASIC)'
],
{
env: {
DOTENV_CONFIG_PATH: './tests/.env'
}
}
}),
),
'basic\n'
)

Expand All @@ -53,7 +63,7 @@ t.equal(
spawn(
[
'-r',
'../config',
path.resolve(__dirname, '../config'),
'-e',
'console.log(process.env.BASIC)',
'dotenv_config_path=./tests/.env'
Expand Down

0 comments on commit 8f04b9d

Please sign in to comment.