Conversation
…ocated Jest (FXA-12610) Migrate test files from test/local/routes/ to co-located .spec.ts files under lib/routes/, following the pattern established by ip-profiling.spec.ts. Mocha originals are kept in place (coexistence). 280 tests across 19 suites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
.spec.tsfiles improve discoverability and reduce deep relative import pathsThis pull request
.spec.tsfiles underlib/routes/, migrating fromtest/local/routes/expect()and preserves sinon spy/stub assertionsproxyquirewithjest.mock()where applicable (auth-oauth, cloud-scheduler, oauth utils)before/after) to Jest equivalents (beforeAll/afterAll)Container.reset()) for typedi-based testsMocha ↔ Jest Parity
test/local/routes/request_helper.jslib/routes/utils/request_helper.spec.tstest/local/routes/validators.jslib/routes/validators.spec.tstest/local/routes/auth-schemes/hawk-fxa-token.jslib/routes/auth-schemes/hawk-fxa-token.spec.tstest/local/routes/auth-schemes/shared-secret.jslib/routes/auth-schemes/shared-secret.spec.tstest/local/routes/auth-schemes/verified-session-token.jslib/routes/auth-schemes/verified-session-token.spec.tstest/local/routes/utils/account.jslib/routes/utils/account.spec.tstest/local/routes/utils/security-event.tslib/routes/utils/security-event.spec.tstest/local/routes/auth-schemes/auth-oauth.jslib/routes/auth-schemes/auth-oauth.spec.tstest/local/routes/auth-schemes/google-oidc.jslib/routes/auth-schemes/google-oidc.spec.tstest/local/routes/auth-schemes/refresh-token.jslib/routes/auth-schemes/refresh-token.spec.tstest/local/routes/cloud-scheduler.jslib/routes/cloud-scheduler.spec.tstest/local/routes/auth-schemes/mfa.jslib/routes/auth-schemes/mfa.spec.tstest/local/routes/cloud-tasks.jslib/routes/cloud-tasks.spec.tstest/local/routes/utils/oauth.jslib/routes/utils/oauth.spec.tstest/local/routes/utils/signup.jslib/routes/utils/signup.spec.tstest/local/routes/utils/clients.jslib/routes/utils/clients.spec.tstest/local/routes/utils/cms/localization.jslib/routes/utils/cms/localization.spec.tstest/local/routes/utils/signin.jslib/routes/utils/signin.spec.tstest/local/routes/mfa.jslib/routes/mfa.spec.tsAll 266 tests have 1:1 assertion parity with their Mocha equivalents. Verified with 5 consecutive green runs (0 flaky tests).
Issue
Closes: https://mozilla-hub.atlassian.net/browse/FXA-12610
Checklist
Other Information
How to verify: