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

feat(plugin): make plugin a "no-op" in unsupported browsers #460

Merged

Conversation

rmacklin
Copy link
Contributor

Addresses #5 (comment)

Previously the plugin would throw an error when it was running in an unsupported browser. This was not great for plugin consumers who run their cypress tests in both supported and unsupported browsers and are fine with only having HAR recording in supported browsers: It forced them to conditionally enable this plugin.

To address this, we're changing the plugin to do nothing except warn that HAR recording is not supported when running in an unsupported browser.

@derevnjuk derevnjuk added the Type: enhancement New feature or request. label Sep 13, 2024
Copy link

codeclimate bot commented Sep 13, 2024

Code Climate has analyzed commit d5d5ea9 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 92.4%.

View more on Code Climate.

@derevnjuk derevnjuk changed the title fix: make plugin a "no-op" in unsupported browsers feat(plugin): make plugin a "no-op" in unsupported browsers Sep 13, 2024
@derevnjuk derevnjuk self-requested a review September 13, 2024 08:26
src/Plugin.ts Outdated Show resolved Hide resolved
src/Plugin.ts Outdated Show resolved Hide resolved
We now enforce the precondition immediately, before we do anything else.
This ensures the precondition error wouldn't be masked by a different
problem.
Without proper setup, this test would start failing if we change the
behavior to be a "no-op" in unsupported browsers.
@rmacklin rmacklin force-pushed the make-it-a-no-op-in-unsupported-browsers branch from 2c2f3ca to 22e6cdf Compare September 13, 2024 22:01
Previously the plugin would throw an error when it was running in an
unsupported browser. This was not great for plugin consumers who run
their cypress tests in both supported and unsupported browsers and are
fine with only having HAR recording in supported browsers: It forced
them to conditionally enable this plugin.

To address this, we're changing the plugin to do nothing except `warn`
that HAR recording is not supported when running in an unsupported
browser.
@rmacklin rmacklin force-pushed the make-it-a-no-op-in-unsupported-browsers branch from 22e6cdf to d5d5ea9 Compare September 13, 2024 22:06
@derevnjuk derevnjuk requested a review from Sija September 16, 2024 09:31
@derevnjuk derevnjuk merged commit 3592682 into NeuraLegion:master Sep 16, 2024
8 checks passed
@derevnjuk
Copy link
Member

@rmacklin thanks for contributing! Great work 💪🏾

@rmacklin rmacklin deleted the make-it-a-no-op-in-unsupported-browsers branch September 16, 2024 15:55
@rmacklin
Copy link
Contributor Author

rmacklin commented Sep 16, 2024

Thank you @derevnjuk! Hoping to switch away from my fork as soon as there's a new release published :)

Edit: Oh, I see you already done that - awesome!

@rmacklin rmacklin removed their assignment Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants