Skip to content

Cleans up tests a little bit#459

Merged
ralexmatthews merged 1 commit intoEasyPost:masterfrom
ralexmatthews:dotenv-for-tests
Jul 22, 2024
Merged

Cleans up tests a little bit#459
ralexmatthews merged 1 commit intoEasyPost:masterfrom
ralexmatthews:dotenv-for-tests

Conversation

@ralexmatthews
Copy link
Copy Markdown
Contributor

Description

This adds support for environment variables in the .env when running tests, and adds a mocharc.json file to hold the mocha commands.

I just added a requirement on the dotenv package, the standard Node.js package for reading .env files, and moved the command line flags from the package.json into a mocharc.json file.

This solves the issues of like:

  • Its been months since I worked on this, what were my API keys again?
  • I need to pass 3 env variables to the tests, and now my command is like 3 lines tall in the terminal

Also fixes the repl command, since that was pointing to a file that didn't exist.

Testing

This is a change to the testing suite itself, so if the tests pass, this is tested, I guess?

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement (fixing a typo, updating readme, renaming a variable name, etc)

@ralexmatthews ralexmatthews requested a review from a team July 22, 2024 15:59
@ralexmatthews ralexmatthews merged commit ef1fd7a into EasyPost:master Jul 22, 2024
@ralexmatthews ralexmatthews deleted the dotenv-for-tests branch July 22, 2024 16:11
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.

2 participants