Skip to content

Commit

Permalink
test(css/minifier): catch error in minifier
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Oct 20, 2022
1 parent 3f648bd commit 1175899
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions crates/swc_css_minifier/tests/fixture.rs
Expand Up @@ -17,16 +17,18 @@ fn minify_fixtures(input: PathBuf) {
input.extension().unwrap().to_string_lossy()
));

testing::run_test(false, |cm, _handler| {
testing::run_test(false, |cm, handler| {
let fm = cm.load_file(&input).unwrap();

let mut errors = vec![];
let res: Result<Stylesheet, _> = parse_file(&fm, Default::default(), &mut errors);

if res.is_err() || !errors.is_empty() {
// TODO uncomment me
// We are not debugging parser
// return Ok(());
for err in errors {
err.to_diagnostics(handler).emit();
}

if handler.has_errors() {
return Err(());
}

let mut ss = res.unwrap();
Expand Down

0 comments on commit 1175899

Please sign in to comment.