From a0b1e487c513f419a2cc312a0ccc6541c5c1f60d Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 18 Sep 2024 20:35:20 +0000 Subject: [PATCH] test: add asserts to validate test assumptions Refs: https://github.com/nodejs/node/pull/54968 Refs: https://github.com/nodejs/node/issues/53382 Add additional asserts as suggestd by Richard in: https://github.com/nodejs/node/pull/54968 Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/54997 Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca --- test/parallel/test-tls-cert-regression.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/parallel/test-tls-cert-regression.js b/test/parallel/test-tls-cert-regression.js index c58998e594ba58..5dab23401302ed 100644 --- a/test/parallel/test-tls-cert-regression.js +++ b/test/parallel/test-tls-cert-regression.js @@ -22,6 +22,7 @@ 'use strict'; const common = require('../common'); const fixtures = require('../common/fixtures'); +const assert = require('assert'); if (!common.hasCrypto) common.skip('missing crypto'); @@ -43,6 +44,8 @@ while (cert[cert.length - 1 - i] === 0x0a) i++; if (i !== 0) cert = cert.slice(0, cert.length - i); function test(cert, key, cb) { + assert.notStrictEqual(cert.at(-1), 0x0a); + assert.notStrictEqual(key.at(-1), 0x0a); const server = tls.createServer({ cert, key