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

Expose utility functions for custom script builder usage #217

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrewatwood
Copy link

Expose internal utilities for use cases where inserting the raw script tag provided by getSDKLoader is not ideal:

  • getSDKScriptUrl to get the src of the output script tag if present
  • getSDKScriptAttributes to get any data-* attributes set on the output script tag if present
  • getSDKInlineScript to get the inline script populating the script tag if present

@@ -1399,3 +1399,67 @@ test("should error when the origin parameter is not just the origin", () => {
throw new Error("Expected error to be thrown");
}
});

describe("Utilities", () => {
Copy link
Author

@andrewatwood andrewatwood Sep 5, 2024

Choose a reason for hiding this comment

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

Rather than checking every utility every time, I figured we could just check that they're equal and go from there. But it might not hurt to add specific assertions for each utility to each test case.

I started there, but bailed when it ended up being so many cases that it seemed redundant.

@andrewatwood andrewatwood marked this pull request as ready for review September 6, 2024 20:43
@andrewatwood andrewatwood requested a review from a team as a code owner September 6, 2024 20:43
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.

1 participant