diff --git a/test/index.js b/test/index.js index 2f0985f..4d5c8bb 100644 --- a/test/index.js +++ b/test/index.js @@ -107,6 +107,16 @@ test ('verify_signature', (t) => { t.deepEqual (obj, dec); }); +test ('do not fail verification if timeout unspecified', async (t) => { + const obj = { foo: 'bar' }; + const str = crypto.sign_object (obj, 'baz'); + await new Promise ((res) => { + setTimeout (res, 10); + }); + const dec = crypto.verify_signature (str, 'baz'); + t.deepEqual (obj, dec); +}); + test ('reject tampered signatures', (t) => { const obj = { foo: 'bar' }; const str = crypto.sign_object (obj, 'baz');