Skip to content

Commit

Permalink
Fix the tests
Browse files Browse the repository at this point in the history
Nothing wrong with the date stuff, just some silly logic errors
  • Loading branch information
rowanmanning committed Mar 22, 2024
1 parent 9c60906 commit ed7d1f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/checks/fastlyKeyExpiration.check.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down

0 comments on commit ed7d1f6

Please sign in to comment.