Skip to content

Commit

Permalink
Merge pull request #515 from motdotla/passing-tests
Browse files Browse the repository at this point in the history
Passing tests
  • Loading branch information
motdotla committed May 5, 2021
2 parents 7301ac9 + fd2d6fa commit 4bcfa7f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ os:
- windows

node_js:
- "8"
- "10"
- "12"

Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Test against these versions of Node.js.
environment:
matrix:
- nodejs_version: "8"
- nodejs_version: "10"
- nodejs_version: "12"

Expand Down
36 changes: 23 additions & 13 deletions tests/test-config-cli.js
Original file line number Diff line number Diff line change
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',
'./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',
'./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',
'./config',
'-e',
'console.log(process.env.BASIC)',
'dotenv_config_path=./tests/.env'
Expand Down
7 changes: 0 additions & 7 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,5 @@ export interface DotenvConfigOutput {
*
*/
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;

/** dotenv library interface */
export interface DotEnv {
config: typeof config;
parse: typeof parse;
}

/** @deprecated since v7.0.0 Use config instead. */
export const load: typeof config;
7 changes: 1 addition & 6 deletions types/test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import * as dotenv from "dotenv";

const { config, parse }: dotenv.DotEnv = {
config: dotenv.config,
parse: dotenv.parse
};
import { config, parse } from "dotenv";

const env = config();
const dbUrl: string | null =
Expand Down

0 comments on commit 4bcfa7f

Please sign in to comment.