David-Kunz / jester

A Neovim plugin to easily run and debug Jest tests
The Unlicense
202 stars 12 forks source link

Cannot reuse the same window #12

Closed tomspeak closed 2 years ago

tomspeak commented 2 years ago

Looking at #8 I was expecting that if I re-ran the command it would re-use the same terminal window.

If I run


:lua require"jester".run()```

it will run the tests, if I then move back to my test code and run the command again, it navigates me to the test terminal split, but does not run anything again.
David-Kunz commented 2 years ago

Hi @tomspeak ,

Could it be that it runs your test, but you would need to scroll down to see it?

Thanks for clarification and best regards, David

tomspeak commented 2 years ago

hey @David-Kunz ,

I've double checked and it has 50 lines of output, and no matter how many times I run the same test, or another test, the first output from the first run never changes.

One potentially interesting thing is that my Jester output window is marked as 'Read Only'. Is it possible that it lacks permissions to 'write' to this 'Read Only' file?

As of right now its the only difference I can see from a first run vs consecutive run is that we create the file, vs try and write to a read only file.

tomspeak commented 2 years ago

OK, I think what may have been happening here is that for some reason my small test case was taking a long time to execute.

If I keep the window open, then make a change to the file, after waiting a while it eventually updates the screen with the new output, but there is no updates until the test has been processed, and it loads all output at once.

With that being said, if I run test A, it completes, then run test B with the same window open, no matter how long I wait, the output in the window never changes from the test A output.

David-Kunz commented 2 years ago

Does it work if you run Jest directly in the terminal?

tomspeak commented 2 years ago

yeah, no issues when using Jest directly in another terminal window/tmux split. The UI updates reactively

David-Kunz commented 2 years ago

And when you execute both tests in the same terminal window?

David-Kunz commented 2 years ago

In the end, Jester does exactly that: It sends commands to the terminal window.

tomspeak commented 2 years ago

Out of nowhere, today, this begun to work as expected.

I cannot see any changes in the Github and I don't recall seeing it being updated by :PackerSync ...

I have no idea what changed, nothing about my set up has, but it is now behaving exactly as it is documented. Confused but thankful!