Skip to content

Conversation

vyadh
Copy link
Contributor

@vyadh vyadh commented Oct 24, 2024

I couldn't use nupm as it was marked as experimental so I thought I'd see how far I could take the "reflection" capabilities of Nushell for basic unit testing. I imagine we could create a somewhat full-featured test framework using something like this technique. I'm somewhat tempted to try 😄.

I can simplify the example by removing the ignored tests and printing of test names if you prefer, but it seemed useful enough to leave in.

@vyadh
Copy link
Contributor Author

vyadh commented Oct 28, 2024

Minor update to comply with #1601 and test compatibility with nupm, which I now realise works in a similar way. Maybe there is some appetite to update nupm to allow the test runner to also work for non-module tests. The use case being what I often do, which is write various test scripts in Nushell, but the implementation might be something else - such as testing infrastructure or even bash scripts.

@fdncred fdncred merged commit ab17ded into nushell:main Oct 28, 2024
2 checks passed
@fdncred
Copy link
Contributor

fdncred commented Oct 28, 2024

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants