Skip to content

Commit

Permalink
fix(cli): do not cache emit when diagnostics present (denoland#12541)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk authored Oct 25, 2021
1 parent 2ab3664 commit 56d9a02
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/proc_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl ProcState {
.map(|cf| ModuleSpecifier::from_file_path(&cf.path).unwrap());
let options = emit::CheckOptions {
debug: self.flags.log_level == Some(log::Level::Debug),
emit_with_diagnostics: true,
emit_with_diagnostics: false,
maybe_config_specifier,
ts_config,
};
Expand Down
32 changes: 32 additions & 0 deletions cli/tests/integration/run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,38 @@ fn rust_log() {
assert!(!output.stderr.is_empty());
}

#[test]
fn dont_cache_on_check_fail() {
let deno_dir = util::new_deno_dir();

let mut deno_cmd = util::deno_cmd_with_deno_dir(deno_dir.path());
let output = deno_cmd
.current_dir(util::testdata_path())
.arg("run")
.arg("--reload")
.arg("error_003_typescript.ts")
.stderr(std::process::Stdio::piped())
.spawn()
.unwrap()
.wait_with_output()
.unwrap();
assert!(!output.status.success());
assert!(!output.stderr.is_empty());

let mut deno_cmd = util::deno_cmd_with_deno_dir(deno_dir.path());
let output = deno_cmd
.current_dir(util::testdata_path())
.arg("run")
.arg("error_003_typescript.ts")
.stderr(std::process::Stdio::piped())
.spawn()
.unwrap()
.wait_with_output()
.unwrap();
assert!(!output.status.success());
assert!(!output.stderr.is_empty());
}

mod permissions {
use test_util as util;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[WILDCARD]
error: Cannot load module "file://[WILDCARD]/does_not_exist.js".
at file://[WILDCARD]/error_missing_module_named_import.ts:1:19
1 change: 0 additions & 1 deletion cli/tests/testdata/localhost_unsafe_ssl.ts.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
DANGER: TLS certificate validation is disabled for: deno.land
error: error sending request for url (https://localhost:5545/subdir/mod2.ts): error trying to connect: invalid certificate: UnknownIssuer
at file://[WILDCARD]/cafile_url_imports.ts:1:28

0 comments on commit 56d9a02

Please sign in to comment.