mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 05:34:58 +02:00
Add example tests (nu-plugin-test-support) for plugins in repo (#12281)
# Description Uses the new `nu-plugin-test-support` crate to test the examples of commands provided by plugins in the repo. Also fixed some of the examples to pass. # User-Facing Changes - Examples that are more guaranteed to work # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib`
This commit is contained in:
@ -54,3 +54,11 @@ impl SimplePluginCommand for Generate2 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_examples() -> Result<(), nu_protocol::ShellError> {
|
||||
use nu_plugin_test_support::PluginTest;
|
||||
|
||||
PluginTest::new("custom_values", crate::CustomValuePlugin.into())?
|
||||
.test_command_examples(&Generate2)
|
||||
}
|
||||
|
Reference in New Issue
Block a user