diff options
Diffstat (limited to 'cli/diagnostics.rs')
-rw-r--r-- | cli/diagnostics.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index ba21e5aa9..af2a63ad9 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -546,7 +546,7 @@ mod tests { } ]); let diagnostics: Diagnostics = serde_json::from_value(value).unwrap(); - let actual = format!("{}", diagnostics); + let actual = diagnostics.to_string(); assert_eq!( strip_ansi_codes(&actual), "TS5023 [ERROR]: Unknown compiler option \'invalid\'." @@ -573,7 +573,7 @@ mod tests { } ]); let diagnostics: Diagnostics = serde_json::from_value(value).unwrap(); - let actual = format!("{}", diagnostics); + let actual = diagnostics.to_string(); assert_eq!(strip_ansi_codes(&actual), "TS2584 [ERROR]: Cannot find name \'console\'. Do you need to change your target library? Try changing the `lib` compiler option to include \'dom\'.\nconsole.log(\"a\");\n~~~~~~~\n at test.ts:1:1"); } @@ -614,7 +614,7 @@ mod tests { } ]); let diagnostics: Diagnostics = serde_json::from_value(value).unwrap(); - let actual = format!("{}", diagnostics); + let actual = diagnostics.to_string(); assert_eq!(strip_ansi_codes(&actual), "TS2552 [ERROR]: Cannot find name \'foo_Bar\'. Did you mean \'foo_bar\'?\nfoo_Bar();\n~~~~~~~\n at test.ts:8:1\n\n \'foo_bar\' is declared here.\n function foo_bar() {\n ~~~~~~~\n at test.ts:4:10"); } @@ -655,7 +655,7 @@ mod tests { } ]; let diagnostics: Diagnostic = serde_json::from_value(value).unwrap(); - let actual = format!("{}", diagnostics); + let actual = diagnostics.to_string(); assert_eq!(strip_ansi_codes(&actual), "TS2551 [ERROR]: Property \'ppid\' does not exist on type \'typeof Deno\'. \'Deno.ppid\' is an unstable API. Did you forget to run with the \'--unstable\' flag, or did you mean \'pid\'?\nconsole.log(Deno.ppid);\n ~~~~\n at file:///cli/tests/unstable_ts2551.ts:1:18\n\n \'pid\' is declared here.\n export const pid: number;\n ~~~\n at asset:///lib.deno.ns.d.ts:90:16"); } } |