mirror of
https://github.com/imjasonh/testscript-rs
synced 2026-07-18 14:46:25 +00:00
Support passing env vars into test environment in setup
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
This commit is contained in:
parent
2cc0cdc0c2
commit
379141a8c7
5 changed files with 84 additions and 27 deletions
|
|
@ -44,6 +44,9 @@ use testscript_rs::testscript;
|
|||
fn test_my_cli() {
|
||||
testscript::run("testdata")
|
||||
.setup(|env| {
|
||||
// Set environment variables for tests
|
||||
env.set_env_var("MY_APP_CONFIG", "/path/to/config");
|
||||
|
||||
// Compile your CLI tool
|
||||
std::process::Command::new("cargo")
|
||||
.args(["build", "--bin", "my-cli"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue