Replies: 1 comment 2 replies
-
the i see two directions for this
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the past I was able to write tests in the same file as the script and run them with
use std testing run-tests ; run-tests
. I don't recall this being a sanctioned method, but it worked and was really convenient for me to include nushell tests into a nix-based ci (production warnings be damned).However, this method has now been deprecated and
nupm
is recommended instead.Based on the readme this workflow no longer seems possible. Instead I need to package the application for
nupm
.I don't really mind this in many instances and I've been wanting to check out
nupm
for awhile, but it can make an already over-engineered weather widget even worse. Additionally, it requires a not-insignificant amount of overhead in both code and knowledge ofnupm
for the same functionality as before (still better than writing bash, though).I skimmed the source code and see that I can export the tests and do something hacky with
scope commands
but this isn't ideal and as far as I can tell things like#[before-all]
wouldn't work. I see the nushell ci is still using the old method, is this going to be changed or does nushell still have access to thetesting
module (if so, I'm curious why it was hidden)?I'm just curious if there is a current or planned method of testing a single
.nu
file. Maybenu_scripts
is a better place for something like this?I'm hope that in the future we will enjoy some nice nix-nupm interoperability (I would be happy to be involved), but until then I would prefer to not use
nupm
in most cases and just have some lower-level functionality that I can include into a nix build.Beta Was this translation helpful? Give feedback.
All reactions