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

Migrate tests from tape to Jest #161

Merged
merged 1 commit into from
Jul 30, 2021
Merged

Migrate tests from tape to Jest #161

merged 1 commit into from
Jul 30, 2021

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Jul 16, 2021

The unit tests have been migrated from tape to Jest. The standard Jest config from the MetaMask module template has been used.

We're using ts-jest to compile the tests and run them all at once, so we don't need a build step for the tests now either. The build command is now run separately on CI.

The tape tests didn't break the tests into sections, which is commonly done for our Jest tests. So describe blocks haven't yet been used. I will be adding describe sections in later PRs though, as the tests are made more comprehensive.

The tests were left mostly functionally equivalent. Some included minor changes, like checking the length of a property rather than just whether it's truthy, or checking the error message, to confirm with our Jest lint rules.

@Gudahtt
Copy link
Member Author

Gudahtt commented Jul 16, 2021

Depends upon #156

@Gudahtt Gudahtt linked an issue Jul 20, 2021 that may be closed by this pull request
Base automatically changed from consolidate-sign-typed-data-methods to main July 26, 2021 19:19
The unit tests have been migrated from tape to Jest. The standard Jest
config from the MetaMask module template has been used.

We're using `ts-jest` to compile the tests and run them all at once, so
we don't need a build step for the tests now either. The `build`
command is now run separately on CI.

The tape tests didn't break the tests into sections, which is commonly
done for our Jest tests. So `describe` blocks haven't yet been used. I
will be adding `describe` sections in later PRs though, as the tests
are made more comprehensive.

The tests were left mostly functionally equivalent. Some included minor
changes, like checking the length of a property rather than just
whether it's truthy, or checking the error message, to confirm with our
Jest lint rules.
@Gudahtt Gudahtt force-pushed the migrate-tests-to-jest branch from 68b6033 to c863ca6 Compare July 26, 2021 19:20
@Gudahtt Gudahtt marked this pull request as ready for review July 26, 2021 19:41
@Gudahtt Gudahtt requested a review from a team as a code owner July 26, 2021 19:41
@Gudahtt Gudahtt mentioned this pull request Jul 27, 2021
@Gudahtt Gudahtt merged commit a81d749 into main Jul 30, 2021
@Gudahtt Gudahtt deleted the migrate-tests-to-jest branch July 30, 2021 17:36
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.

consider moving test to jest
2 participants