Merge pull request #928 from alexcrichton/node-args

Allow passing extra args to node in test runner
This commit is contained in:
Alex Crichton 2018-10-04 23:13:58 -07:00 committed by GitHub
commit e368e49af1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,9 +92,16 @@ pub fn execute(
let mut path = env::split_paths(&path).collect::<Vec<_>>();
path.push(env::current_dir().unwrap());
path.push(tmpdir.to_path_buf());
let extra_node_args = env::var("NODE_ARGS")
.unwrap_or_default()
.split(",")
.map(|s| s.to_string())
.filter(|s| !s.is_empty())
.collect::<Vec<_>>();
exec(
Command::new("node")
.env("NODE_PATH", env::join_paths(&path).unwrap())
.args(&extra_node_args)
.arg(&js_path)
.args(args),
)