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

Fishtape 3 #53

Closed
jorgebucaran opened this issue Nov 27, 2020 · 0 comments
Closed

Fishtape 3 #53

jorgebucaran opened this issue Nov 27, 2020 · 0 comments
Labels
meta Announcements, migration guides, news

Comments

@jorgebucaran
Copy link
Owner

jorgebucaran commented Nov 27, 2020

It's that time of the year again. The plan is to use Fish 3.0, make Fishtape faster, smaller, revise the API, and whatnot.

The biggest breaking change will be going back to running tests serially. This makes your tests behave more predictably and might even make most tests out there faster since we'd no longer block (per file), need that extra subshell, or have to handle background jobs.

Serial processing also means we don't have to preprocess test files anymore, so setup and teardown are no longer necessary. The best way to do work before and after a test is simply right there in your test file.

I also think it's a good time to remove all the magic left in Fishtape, e.g.: automatically collapsing newlines in test arguments.

Consider this (surprisingly) passing test:

@test (seq 3) = "1 2 3"

This is magic. The right way to write this is:

@test (echo (seq 3)) = "1 2 3"

# or

@test (seq 3 | string join " ") = "1 2 3"

Magic makes it more difficult to reason about your code because it violates the principle of WYSIWYG. If you want to turn (seq 3) into "1 2 3" you really need use to echo or pipe it into string join " ", which is a bit more code than before, but at least it's correct, so when things break it will be more likely your code and not Fishtape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Announcements, migration guides, news
Projects
None yet
Development

No branches or pull requests

1 participant