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

Starting the REPL with suitest.interactive changes the working directory and doesn't change it back #390

Closed
onlynone opened this issue Aug 5, 2021 · 1 comment
Labels
wontfix This will not be worked on

Comments

@onlynone
Copy link

onlynone commented Aug 5, 2021

If you start the REPL with await suitest.interactive(), it'll change the working directory to the directory of the file from where you called suitest.interactive(). It doesn't change back after you run .exit and leave the REPL to continue normal operations. If you do any file operations relative to the current working directory, like trying to save a screenshot with: suitest.saveScreenshot('./some/dir/image.png'), then it'll likely fail, since the directory is supposed to exist relative to where you executed the tests, not relative to the file where you started a REPL.

I think you should either:

  1. Don't support changing directories upon entering the REPL at all. If the user wants to change directory, they'd have to do so themselves explicitly with process.chdir(wherever), and if they don't change back before exiting the REPL, that's on them. Or:
  2. Only change directory if cwd is explicitly given in await suiteest.interactive({cwd: something}). If it's missing or null or undefined, then don't change directory at all. If it is specified, maybe combine with the behavior of the next one. Or:
  3. Keep the current chdir behavior as-is, but store the old cwd prior to changing directories, and chdir back to it after exiting the REPL.
onlynone added a commit to PhiloInc/suitest-js-api that referenced this issue Sep 30, 2021
onlynone added a commit to PhiloInc/suitest-js-api that referenced this issue Sep 30, 2021
@polomsky polomsky added the wontfix This will not be worked on label Dec 29, 2022
@polomsky
Copy link
Member

Version 2.x is deprecated.

@polomsky polomsky closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants