You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
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:
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.
The text was updated successfully, but these errors were encountered:
onlynone
added a commit
to PhiloInc/suitest-js-api
that referenced
this issue
Sep 30, 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 calledsuitest.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:
process.chdir(wherever)
, and if they don't change back before exiting the REPL, that's on them. Or:cwd
is explicitly given inawait suiteest.interactive({cwd: something})
. If it's missing ornull
orundefined
, then don't change directory at all. If it is specified, maybe combine with the behavior of the next one. Or:chdir
behavior as-is, but store the oldcwd
prior to changing directories, andchdir
back to it after exiting the REPL.The text was updated successfully, but these errors were encountered: