1
0
Fork 0
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:
copilot-swe-agent[bot] 2025-12-30 01:46:37 +00:00
parent 2cc0cdc0c2
commit 379141a8c7
5 changed files with 84 additions and 27 deletions

View file

@ -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"])