diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit_node/tls_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit_node/tls_test.ts b/tests/unit_node/tls_test.ts index 6826ab84c..7daa544c7 100644 --- a/tests/unit_node/tls_test.ts +++ b/tests/unit_node/tls_test.ts @@ -1,9 +1,11 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { + assert, assertEquals, assertInstanceOf, assertStringIncludes, + assertThrows, } from "@std/assert"; import { delay } from "@std/async/delay"; import { fromFileUrl, join } from "@std/path"; @@ -215,3 +217,13 @@ Deno.test("tls.connect() throws InvalidData when there's error in certificate", "InvalidData: invalid peer certificate: UnknownIssuer", ); }); + +Deno.test("tls.rootCertificates is not empty", () => { + assert(tls.rootCertificates.length > 0); + assert(Object.isFrozen(tls.rootCertificates)); + assert(tls.rootCertificates instanceof Array); + assert(tls.rootCertificates.every((cert) => typeof cert === "string")); + assertThrows(() => { + (tls.rootCertificates as string[]).push("new cert"); + }, TypeError); +}); |