Skip to content

fix(testing): Improve error when clerkSetup does not run before tests#3520

Merged
anagstef merged 3 commits intomainfrom
stefanos/fix-missing-fapi-error
Jun 6, 2024
Merged

fix(testing): Improve error when clerkSetup does not run before tests#3520
anagstef merged 3 commits intomainfrom
stefanos/fix-missing-fapi-error

Conversation

@anagstef
Copy link
Copy Markdown
Member

@anagstef anagstef commented Jun 5, 2024

Description

When setupClerkTestingToken cannot find the FAPI URL, it means that the clerkSetup function has not initialized properly on the global setup step.

This PR improves the error message thrown to say the following:
The Clerk Frontend API URL is required to bypass bot protection. Make sure the clerkSetup function is called during your global setup before setupClerkTestingToken is called.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@anagstef anagstef requested review from agis and alexisintech June 5, 2024 16:26
@anagstef anagstef self-assigned this Jun 5, 2024
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 5, 2024

🦋 Changeset detected

Latest commit: 72c6643

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Member

@alexisintech alexisintech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it :) thank you

@anagstef anagstef merged commit a9fb285 into main Jun 6, 2024
@anagstef anagstef deleted the stefanos/fix-missing-fapi-error branch June 6, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants