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
Hi there, I am getting used to using dax for testing a cli tool I am building in deno. Usage of that cli might look like forager search --tag foobar. Generally this means I want to have test scripts run something like so:
constcli_entrypoint=path.join(path.resolve(import.meta.dirname,'..'),'src/cli.ts')await$`deno run ${cli_entrypoint} -A --unstable-ffi search --tag foobar`
This is a little verbose though, so I have trying to come up with a way to shorthand the first bit of boilerplate in that command into something like so:
constcli_entrypoint=path.join(path.resolve(import.meta.dirname,'..'),'src/cli.ts')constFORAGER_BIN=`deno run ${cli_entrypoint} -A --unstable-ffi`await$`${FORAGER_BIN} search --tag foobar`
this doesnt seem to be a viable option however, and I get errors like this from dax:
dax: deno run --check -A --unstable-ffi /Users/andrew.kaiser/Code/andykais/forager/monorepo/packages/cli/src/cli.ts: command not found
I have had success using $.raw like so:
constcli_entrypoint=path.join(path.resolve(import.meta.dirname,'..'),'src/cli.ts')constFORAGER_BIN=`deno run ${cli_entrypoint} -A --unstable-ffi`await$.raw`${FORAGER_BIN} search --tag foobar`
however I do like the auto-escape behavior dax provides, since this is another common command I want to run inside tests:
and that feels a tag verbose. Generally I am hoping there is a way to tell dax to not escape that first part of the command, or use some kind of builder pattern for dax that makes this more practical. This may not be possible but I figured its worth asking!
The text was updated successfully, but these errors were encountered:
Hi there, I am getting used to using dax for testing a cli tool I am building in deno. Usage of that cli might look like
forager search --tag foobar
. Generally this means I want to have test scripts run something like so:This is a little verbose though, so I have trying to come up with a way to shorthand the first bit of boilerplate in that command into something like so:
this doesnt seem to be a viable option however, and I get errors like this from dax:
I have had success using
$.raw
like so:however I do like the auto-escape behavior dax provides, since this is another common command I want to run inside tests:
and that feels a tag verbose. Generally I am hoping there is a way to tell dax to not escape that first part of the command, or use some kind of builder pattern for dax that makes this more practical. This may not be possible but I figured its worth asking!
The text was updated successfully, but these errors were encountered: