nushell.github.io icon indicating copy to clipboard operation
nushell.github.io copied to clipboard

Replace std testing with nupm

Open texastoland opened this issue 1 year ago • 5 comments

std testing module went from deprecated to removed since nushell/nushell#11331 in 0.90.0. Now requires nupm.

texastoland avatar Feb 18 '24 05:02 texastoland

It's also in nu_scripts if you still want to use it.

fdncred avatar Feb 18 '24 12:02 fdncred

Probably not helpful to document both ways though.

texastoland avatar Feb 18 '24 20:02 texastoland

@fdncred I'm down now if you're open to it. I wouldn't discuss nupm itself. Basically:

  1. Clone nupm
  2. Add it to $env.NU_LIB_DIRS
  3. Create empty nupm.nuon (I think this should be relaxed)
  4. Create sibling tests directory
  5. Create mod.nu
  6. Add export def using std assert
  7. nupm test to run all visible commands
  8. --dir flag to target a different path

texastoland avatar Mar 16 '24 20:03 texastoland

seems like a pain to me.

Seems easier just to use crates/nu-std/testing.nu

But I don't really care, if others like this strategy.

fdncred avatar Mar 16 '24 21:03 fdncred

seems like a pain to me.

NGL I wish nupm was included under an experimental module or something.

Seems easier just to use crates/nu-std/testing.nu

I don't use Rust to manage non-Rust stuff though. FWIW half of those are nearly identical to (in a way less complicated than) std testing.

But I don't really care, if others like this strategy.

CC @kubouch or whoever has an opinion. Just combing through issues I was interested in.

texastoland avatar Mar 16 '24 21:03 texastoland