Closed nsbarsukov closed 1 year ago
Latest commit: c35beb552763e46eb3c23d6b0e4b5e64040cd7ff
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@jaredpalmer could you review my contribution, please ?
Hi! I am a user of your plugin. I try to write my own plugin using your plugin as a basis. But I have faced with this problem.
Problem: Imagine that you have
plugin.js
-file:And you have this
command.js
-file:Finally, everything is wrapped by
index.js
-file:When you try to import plugin and command from your
index.js
and use it inside your cypress-tests, you will get error:This happens because exporting of the plugin happens earlier than command (when
Cypress
is not yet ready). But some code (the changed lines of this PR) is not isolated by any function scope and we get the error. My PR will help to solve this problem without changing any logic of your code.