-
-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(transform_conformance): clean up some code (#7354)
- Loading branch information
Showing
3 changed files
with
48 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use std::{path::Path, process::Command}; | ||
|
||
use crate::{conformance_root, TestRunner}; | ||
|
||
impl TestRunner { | ||
pub(crate) fn run_vitest(&self, dest: &Path) { | ||
let version = String::from("node: ") | ||
+ &String::from_utf8(Command::new("node").arg("--version").output().unwrap().stdout) | ||
.unwrap(); | ||
let output = Command::new("node") | ||
.current_dir(conformance_root()) | ||
.env("NO_COLOR", "1") | ||
.args([ | ||
"--run", | ||
"vitest", | ||
"--", | ||
"run", | ||
"--reporter=basic", | ||
"--exclude=\"\"", | ||
"--no-color", | ||
"./fixtures", | ||
]) | ||
.output() | ||
.unwrap(); | ||
let content = if output.stderr.is_empty() { output.stdout } else { output.stderr }; | ||
let output = String::from_utf8(content).unwrap(); | ||
let output = version + &output; | ||
self.snapshot.save(dest, &output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters