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
Just upgraded to V2? You'll need to make some adjustments. In this issue, I'll explain what these changes are and how to migrate your tests. 🙌
Background
Fishtape V1 test syntax wasn't valid Fish syntax. Running fishtape test.fish transformed test blocks to valid to test builtin declarations under the hood.
That means you couldn't use fish_indent to format your files. Blocks didn't let you create multiple assertions either, defeating the purpose of a "block" in the first place. Even if you never used fish_indent, why write pseudo-Fish code when you can write real Fish?
What's new?
V2 introduces a new @test function. It wraps the test builtin, so you can specify an optional description for your test. Another small difference is no support for -o or -a operators.
Here are some examples:
@test"current directory is home"$PWD = $HOME
@test"hello has length 5" (string length "hello") = 5
@test"math still works" 42 -eq (math 41 + 1)
@test"test is a builtin" (contains -- test (builtin-n)) $status-eq 0
Also new is the @mesg function. It creates a TAP comment like # my message that will be written together with the TAP output.
Other changes include the removal of all special variables, leaving only $current_filename. If we need more variables, we can always add them later when the need arises.
The text was updated successfully, but these errors were encountered:
jorgebucaran/fishtape#38
Note that the --local scope of setup vars was removed because it was
no longer working with function's -S/--no-scope-shadowing option. Which
was causing teardown to fail.
Just upgraded to V2? You'll need to make some adjustments. In this issue, I'll explain what these changes are and how to migrate your tests. 🙌
Background
Fishtape V1 test syntax wasn't valid Fish syntax. Running
fishtape test.fish
transformed test blocks to valid totest
builtin declarations under the hood.That means you couldn't use
fish_indent
to format your files. Blocks didn't let you create multiple assertions either, defeating the purpose of a "block" in the first place. Even if you never usedfish_indent
, why write pseudo-Fish code when you can write real Fish?What's new?
V2 introduces a new
@test
function. It wraps thetest
builtin, so you can specify an optional description for your test. Another small difference is no support for-o
or-a
operators.Here are some examples:
Also new is the
@mesg
function. It creates a TAP comment like# my message
that will be written together with the TAP output.Other changes include the removal of all special variables, leaving only
$current_filename
. If we need more variables, we can always add them later when the need arises.The text was updated successfully, but these errors were encountered: