barrysteyn / node-scrypt

Scrypt for Node
370 stars 88 forks source link

AssertionError: expected [Error] to match /^Error #131

Open gperciva opened 8 years ago

gperciva commented 8 years ago

Fresh install on Ubuntu 16.04 (inside virtualbox). I'm guessing it's a simple regex typo?

  71 passing (1s)
  2 failing

  1) Scrypt Node Module Tests Scrypt Hash Function Verify Hash Synchronous functionality with incorrect arguments Will throw an Error if KDF buffer is not a valid scrypt-encrypted block:
     AssertionError: expected [Error] to match /^Error: data is not a valid scrypt-encrypted block$/
      at Context.<anonymous> (tests/scrypt-tests.js:493:17)

  2) Scrypt Node Module Tests Scrypt Hash Function Verify Hash Asynchronous functionality with incorrect arguments Will throw an Error if KDF buffer is not a valid scrypt-encrypted block:
     AssertionError: expected [Error] to match /^Error: data is not a valid scrypt-encrypted block$/
      at Context.<anonymous> (tests/scrypt-tests.js:558:17)
BrandonZacharie commented 8 years ago

I'm able to replicate that. I'll take a deeper look this weekend.

screen shot 2016-07-01 at 18 56 29
BrandonZacharie commented 8 years ago

The regular expressions in those two tests are not much different than in any of the other tests. It appears that the string representations of the error objects produced in those two tests are the culprits; In fact, I get different output on every run.

screen shot 2016-07-05 at 09 43 45 screen shot 2016-07-05 at 09 42 44

I suspect there's something different in how those errors are constructed and/or handled/stringified.

barrysteyn commented 8 years ago

Hi

I am sorry, I am in the middle of getting married :) I will be back home on the 10th of Jul and then give me some time to settle down and I will sort this out. Apologies for lack of response, but wedding stuff takes quite a lot of time.

gperciva commented 8 years ago

Congratulations! No rush; I just happened to notice it while investigating #123.

barrysteyn commented 8 years ago

Sorry for the delay. I will look into this on Sat. Again, apologies.