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

chore: add browser testing to fuel-gauge #2319

Closed
wants to merge 14 commits into from

Conversation

danielbate
Copy link
Contributor

@danielbate danielbate commented May 16, 2024

Closes #284

Builds on #2123 to utilise typegen in tests, meaning we require less polyfilled/reimplemented functionality.

  • child_process can't be polyfilled, so I am now dynamically importing it in a non-browser environment. This has made version related functionality async. This is likely to not be a problem if account was tree-shakeable.

@danielbate danielbate added the chore Issue is a chore label May 16, 2024
@danielbate danielbate self-assigned this May 16, 2024
{
stdio: 'pipe',
if (process.env.VITEST && process.env.VITEST_ENV !== 'browser') {
const { spawn } = await import('child_process');
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that tests running in the browser won't need a polyfill for this this import? If so, cool stuff!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It sure does!

@danielbate
Copy link
Contributor Author

Superseded by work in #2378

@danielbate danielbate closed this May 23, 2024
@petertonysmith94 petertonysmith94 deleted the db/chore/fuel-gauge-browser-test branch May 24, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create test to browser compatibility
2 participants