JonathanWilbur / asn1-ts

ASN.1 TypeScript library, including codecs for Basic Encoding Rules (BER) and Distinguished Encoding Rules (DER).
MIT License
32 stars 6 forks source link

test/x690/constructor.test.js failed #24

Closed hamano closed 1 year ago

hamano commented 1 year ago

npm t failed for master branch The test looks good for me...

  ● Function's constructor › encodes a Date correctly

    expect(received).toBe(expected) // Object.is equality

    Expected: "2019-11-"
    Received: "2019-12-"

      110 |             );
      111 |             expect(el.generalizedTime.toISOString().slice(0, 8))
    > 112 |                 .toBe((new Date(2019, 10, 3)).toISOString().slice(0, 8));
          |                  ^
      113 |         });
      114 |     });
      115 | });

      at Object.toBe (test/x690/constructor.test.js:112:18)
JonathanWilbur commented 1 year ago

I just ran this locally on master and it worked for me. I suspect, with a test like this that compares dates, you might have run this at the brink of midnight or something. I am going to close this, but feel free to re-open this if this issue pops back up and I'll look into this deeper.