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

fix: stub sdk-test-helpers in browser environments #132

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented Apr 1, 2021

The "sdk-test-helpers" file contains helper functions that generated SDKs use
in their generated unit tests. These functions are never actually needed when
running standard operational code, therefore they are never used in the browser.

The expect library that we use for testing has a dependency that isn't browser
friendly in certain scenarios. This causes the core and any SDKs importing it
to throw errors in these scenarios (like the React framework).

This change stubs the sdk-test-helpers in browser environments the same way we
stub the credentials file reading code. I've verified that this fix works in the problematic environments

cc @apaparazzi0329

The "sdk-test-helpers" file contains helper functions that generated SDKs use
in their generated unit tests. These functions are never actually needed when
running standard operational code, therefore they are never used in the browser.

The `expect` library that we use for testing has a dependency that isn't browser
friendly in certain scenarios. This causes the core and any SDKs importing it
to throw errors in these scenarios (like the React framework).

This change stubs the sdk-test-helpers in browser environments the same way we
stub the credentials file reading code.
Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

LGTM

@dpopp07 dpopp07 merged commit 006991b into main Apr 1, 2021
@dpopp07 dpopp07 deleted the dp/browserify-test-helpers branch April 1, 2021 20:53
ibm-devx-automation pushed a commit that referenced this pull request Apr 1, 2021
## [2.10.3](v2.10.2...v2.10.3) (2021-04-01)

### Bug Fixes

* stub sdk-test-helpers in browser environments ([#132](#132)) ([006991b](006991b))
@ibm-devx-automation
Copy link

🎉 This PR is included in version 2.10.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants