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

clients/js: add worm cli tests (parse, recover, info) + worm submit (testing all chains) #3229

Conversation

AlberErre
Copy link
Contributor

@AlberErre AlberErre commented Jul 23, 2023

Resolves #2596

This PR adds unit tests for cmds commands on worm CLI located on client/ts/__tests__

Functionality tests added (to cover all cases dynamically):

A Github Actions (.github/workflows/worm-cli.yml) has been created to integrate all these tests & build process into wormhole pipelines 🚀

Also, a jest.config.json file has been added to configure jest testing environment.

MSW

In order to test worm submit functionality, a mocking network utility tool has been used msw.js.

This tool captures the network calls made in jest testing environment. Then each test verifies the transaction HTTP calls has been made for each chain case, testing both positive cases (happy path, sends transaction to network) and negative cases (wrong VAA submitted for worm submit command).

How to run

Navigate to client/js folder:

cd client/js 

Local configuration

# ensure we're using node 16, loading .nvmrc file
nvm use 

⚠️ You need to have ENV variables for each chain declared (in order to worm submit to work properly).

Set ENV variables on your local machine by running the following command:

npm run test:env

Run tests

npm ci
npm run make
npm run test-ci

@AlberErre AlberErre force-pushed the clients/js/test-worm-cli-submit-all-chains branch from 79b542a to c0e1d2e Compare August 14, 2023 12:02
@evan-gray
Copy link
Contributor

Same / duplicate of #2631

@evan-gray evan-gray closed this Mar 14, 2024
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.

clients/js: add tests
2 participants