Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Sep 11, 2024
1 parent 8784716 commit 39eb431
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
15 changes: 13 additions & 2 deletions tests/integration/js_unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,21 @@ fn js_unit_test(test: String) {
}

// Some tests require the root CA cert file to be loaded.
if test == "websocket_test" || test == "tls_sni_test" {
deno = deno.arg("--cert=./cli/tests/tls/RootCA.pem")
if test == "websocket_test" {
deno = deno.arg(format!(
"--cert={}",
util::testdata_path()
.join("tls")
.join("RootCA.pem")
.to_string_lossy()
));
};

if test == "tls_sni_test" {
// TODO(lucacasonato): fix the SNI in the certs so that this is not needed
deno = deno.arg("--unsafely-ignore-certificate-errors");
}

let mut deno = deno
.arg("-A")
.arg(util::tests_path().join("unit").join(format!("{test}.ts")))
Expand Down
9 changes: 4 additions & 5 deletions tests/integration/node_unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,15 @@ fn node_unit_test(test: String) {
.arg("-A");

// Some tests require the root CA cert file to be loaded.
deno = if test == "http2_test" {
deno.arg("--cert=./cli/tests/tls/RootCA.pem")
} else {
deno
};
if test == "http2_test" || test == "http_test" {
deno = deno.arg("--cert=./tests/testdata/tls/RootCA.pem");
}

// Parallel tests for crypto
if test.starts_with("crypto/") {
deno = deno.arg("--parallel");
}

let mut deno = deno
.arg(
util::tests_path()
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/net_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Deno.test(
} else if (e.message === "Another accept task is ongoing") {
acceptErrCount++;
} else {
throw new Error("Unexpected error message");
throw e;
}
};
const p = listener.accept().catch(checkErr);
Expand All @@ -188,7 +188,7 @@ Deno.test(
const listener = Deno.listen({ transport: "unix", path: filePath });
let acceptErrCount = 0;
const checkErr = (e: Error) => {
if (e.message === "Listener has been closed") {
if (e.message === "operation canceled") {
assertEquals(acceptErrCount, 1);
} else if (e instanceof Deno.errors.Busy) { // "Listener already in use"
acceptErrCount++;
Expand Down

0 comments on commit 39eb431

Please sign in to comment.