Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Improve address verification unit tests #430

Merged
merged 3 commits into from Jan 8, 2024
Merged

Conversation

nwithan8
Copy link
Member

@nwithan8 nwithan8 commented Jan 8, 2024

Description

See EasyPost/easypost-csharp#540 for more details.

  • Update examples submodule for new "incorrect address" fixture
  • Update address verification unit tests to better test target functionality

Testing

  • Update unit tests, re-record cassettes as needed
  • Update CI to match other libraries (run unit tests in all Node versions, run linting and coverage analysis only in the latest Node version)

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)

@nwithan8 nwithan8 marked this pull request as ready for review January 8, 2024 19:20
@nwithan8 nwithan8 requested a review from a team as a code owner January 8, 2024 19:20
@nwithan8
Copy link
Member Author

nwithan8 commented Jan 8, 2024

CI is failing on Node 12, seems to be an issue with an npm package used for coverage:

Run EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
npm run coverage

> @easypost/api@7.0.0 coverage /home/runner/work/easypost-node/easypost-node
> cross-env NODE_ENV=test nyc npm run test

Unexpected token '?'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @easypost/api@7.0.0 coverage: `cross-env NODE_ENV=test nyc npm run test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @easypost/api@7.0.0 coverage script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/202[4](https://github.com/EasyPost/easypost-node/actions/runs/7452210211/job/20275123483?pr=430#step:7:5)-01-08T19_28_24_20[5](https://github.com/EasyPost/easypost-node/actions/runs/7452210211/job/20275123483?pr=430#step:7:6)Z-debug.log
make: *** [Makefile:[15](https://github.com/EasyPost/easypost-node/actions/runs/7452210211/job/20275123483?pr=430#step:7:16): coverage] Error 1
Error: Process completed with exit code 2.

Can't seem to re-create locally with the same environment:
image

image

UPDATE: It's Chai using syntax that only exists in Node 14+: chaijs/chai#1553 (comment)

✖ ERROR: /home/runner/work/easypost-node/easypost-node/node_modules/chai/lib/chai/assertion.js:69
    flag(this, 'eql', config.deepEqual ?? util.eql);

@nwithan8 nwithan8 merged commit 5216432 into master Jan 8, 2024
8 checks passed
@nwithan8 nwithan8 deleted the incorrect_address branch January 8, 2024 20:52
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.

None yet

3 participants