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

Snapshot files are always empty | Stuck on Step 5 - "Testing" #1471

Open
matgianesini opened this issue Sep 14, 2020 · 1 comment
Open

Snapshot files are always empty | Stuck on Step 5 - "Testing" #1471

matgianesini opened this issue Sep 14, 2020 · 1 comment

Comments

@matgianesini
Copy link

I can't figure out something about jest testing of the server. I'm at Server Step 3.2, and my test passes, and the console also reads "Snapshots: 1 written". The problem is that the file getChats.test.ts.snap gets created but it only ever says "*** Contents:" and nothing else.

To add to my confusion, I downloaded your original repo and git checked out the relevant step, but I encountered the same behavior. Lastly as a sanity check I did a clean clone of the repo, stayed in Master branch, and opened the .snap files in /tests/queries/snapshots. They all say "*** Contents:" and nothing else. Even though looking at the file in the browser, on the same branch, you can see its contents.

@matgianesini
Copy link
Author

It turns out everything was working as expected. My only problem was using the program called 'less' for opening and viewing the *.test.ts.snap files. It didn't occur to me that 'less' could be the culprit, as I always use it for quickly viewing files in the command line and had never had any issue.

I still don't know why 'less' is incompatible with these files, but that is out of scope here. So for any other people with terminal based workflows: open snapshot files with VIM or something other than 'less'. Lastly, the program called 'more' does display the file correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant