Skip to content

feat(repo,testing): Apply testing tokens to E2E tests #5561

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

Merged
merged 8 commits into from
Apr 9, 2025

Conversation

tmilewski
Copy link
Member

Description

Integration Tests:

This PR applies testing tokens to E2E tests via existing pathways.
It also creates u.po.testingToken.setup() for tests which live outside existing helper-specific flows.

@clerk/testing

I've added two additional options to setupClerk to facilitate the functionality above:

  • secretKey: Allow for explicitly passing the secret key
  • dotenv: Enable automatic loading of dotenv files. Defaults to true

Fixes SDKI-982

Checklist

  • pnpm test runs as expected.
  • pnpm 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:

@tmilewski tmilewski self-assigned this Apr 8, 2025
Copy link

changeset-bot bot commented Apr 8, 2025

🦋 Changeset detected

Latest commit: 4b88762

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

vercel bot commented Apr 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2025 1:29pm

@tmilewski tmilewski changed the title feat(repo): Apply testing tokens to E2E tests feat(repo,testing): Apply testing tokens to E2E tests Apr 8, 2025
@tmilewski tmilewski force-pushed the tm/sdki-982-apply-testing-tokens-to-e2e-tests branch from 84e82d0 to ef8eca4 Compare April 8, 2025 21:26
@tmilewski tmilewski changed the title feat(repo,testing): Apply testing tokens to E2E tests feat(integration,testing): Apply testing tokens to E2E tests Apr 8, 2025
Copy link
Member

@anagstef anagstef left a comment

Choose a reason for hiding this comment

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

Great job! 🚀

@@ -5,24 +5,29 @@ import dotenv from 'dotenv';
import type { ClerkSetupOptions, ClerkSetupReturn } from './types';

export const fetchEnvVars = async (options?: ClerkSetupOptions): Promise<ClerkSetupReturn> => {
const { debug = false, dotenv: loadDotEnv = true, ...rest } = options || {};
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Why not destruct also publishableKey and secretKey here? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

@anagstef No specific reason. Makes sense, I'll update. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

@anagstef Looking back at the code, it was cleaner to do it this way such that there weren't variable naming conflicts.

@tmilewski tmilewski changed the title feat(integration,testing): Apply testing tokens to E2E tests feat(repo,testing): Apply testing tokens to E2E tests Apr 9, 2025
@tmilewski tmilewski enabled auto-merge (squash) April 9, 2025 13:35
@tmilewski tmilewski merged commit 698d5d7 into main Apr 9, 2025
30 checks passed
@tmilewski tmilewski deleted the tm/sdki-982-apply-testing-tokens-to-e2e-tests branch April 9, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants