Skip to content

Commit 94db921

Browse files
committed
fix tests
1 parent 2565462 commit 94db921

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

tests/spec_test.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ use std::path::{Path, PathBuf};
22
use std::sync::Arc;
33

44
use anyhow::Result;
5-
use deno_ast::MediaType;
65
use dprint_core::configuration::*;
76
use dprint_development::*;
87
use dprint_plugin_typescript::configuration::*;
98
use dprint_plugin_typescript::*;
109

11-
fn external_formatter(media_type: MediaType, text: String, config: &Configuration) -> Result<Option<String>> {
12-
match media_type {
13-
MediaType::Css => format_embedded_css(&text, config),
14-
MediaType::Html => format_html(&text, config),
15-
MediaType::Sql => format_sql(&text, config),
16-
_ => unreachable!(),
10+
fn external_formatter(lang: &str, text: String, config: &Configuration) -> Result<Option<String>> {
11+
match lang {
12+
"css" => format_embedded_css(&text, config),
13+
"html" => format_html(&text, config),
14+
"sql" => format_sql(&text, config),
15+
_ => Ok(None),
1716
}
1817
}
1918

0 commit comments

Comments
 (0)