From ed7d1f67030e001d72b0abbc1930e66df19ff025 Mon Sep 17 00:00:00 2001 From: Rowan Manning <138944+rowanmanning@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:30:35 +0000 Subject: [PATCH] Fix the tests Nothing wrong with the date stuff, just some silly logic errors --- src/checks/fastlyKeyExpiration.check.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checks/fastlyKeyExpiration.check.js b/src/checks/fastlyKeyExpiration.check.js index 8003910..24d1335 100644 --- a/src/checks/fastlyKeyExpiration.check.js +++ b/src/checks/fastlyKeyExpiration.check.js @@ -84,7 +84,7 @@ class FastlyKeyExpirationCheck extends Check { let date; try { date = new Date(stringDate); - dateIsValid = Number.isNaN(date.getDate()); + dateIsValid = !Number.isNaN(date.getDate()); } catch (error) { dateIsValid = false; } @@ -109,7 +109,7 @@ class FastlyKeyExpirationCheck extends Check { switch (true) { case expirationDate > limitDate: return this.states.PASSED; - case expirationDate < now: + case expirationDate <= now: return this.states.FAILED_URGENT_VALIDATION; default: return this.states.FAILED_VALIDATION;