Skip to content

Conversation

@goatandsheep
Copy link

fixes #36

@goatandsheep
Copy link
Author

dotenv-extended tests
✓ Should load .env file into process.env and not override process.env properties by default
✓ Should load .env file into process.env and override process.env properties with overrideProcessEnv set to true
✓ Should load take configuration values from environment variables
✓ Should throw an error when items from schema are missing and errorOnMissing is true
✓ Should throw an error when there are extra items that are not in schema and errorOnExtra is true
✓ Should process process.env variables before checking errors when includeProcessEnv is true
1) Should load schema, defaults and env into correct values in process.env and returned object
2) Should not load .env files into process.env if assignToProcessEnv is false
✓ Should pass regex validation when errorOnRegex is true and values match patterns
✓ Should throw a SyntaxError when a schema regex is invalid and errorOnRegex is true
✓ Should not throw a SyntaxError when a schema regex is invalid but errorOnRegex is false
✓ Should throw an error when an item does not match schema regex and errorOnRegex is true
✓ Should default missing values to empty string when errorOnRegex is true
3) Should log an error when silent is set to false and .env.defaults is missing

Supporting libraries tests
✓ parseCommand should parse command line arguments correctly
✓ getConfigFromEnv should parse environment variable config values correctly

13 passing (48ms)
3 failing

  1. dotenv-extended tests
    Should load schema, defaults and env into correct values in process.env and returned object:
    Error: EXTRA CONFIG VALUES: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
    at Object.config (/workspaces/node-dotenv-extended/lib/index.js:1:27426)
    at Context. (test.spec.js:91:33)
    at Context. (test.spec.js:35:9)
    at processImmediate (internal/timers.js:461:21)

  2. dotenv-extended tests
    Should not load .env files into process.env if assignToProcessEnv is false:
    Error: EXTRA CONFIG VALUES: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
    at Object.config (/workspaces/node-dotenv-extended/lib/index.js:1:27426)
    at Context. (test.spec.js:107:33)
    at Context. (test.spec.js:35:9)
    at processImmediate (internal/timers.js:461:21)

  3. dotenv-extended tests
    Should log an error when silent is set to false and .env.defaults is missing:
    AssertionError: expected error to have been called exactly once, but it was called 0 times
    at Context. (test.spec.js:180:51)
    at Context. (test.spec.js:35:9)
    at processImmediate (internal/timers.js:461:21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question: Possible to load multiple .env files into the shell?

1 participant