add stryker, test for timeout valid signature
This commit is contained in:
		| @@ -103,6 +103,16 @@ test ('reject old signatures', async (t) => { | ||||
|   t.is (dec, null); | ||||
| }); | ||||
|  | ||||
| test ('do not reject valid signatures', 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', 100); | ||||
|   t.deepEqual (obj, dec); | ||||
| }); | ||||
|  | ||||
| test ('decode problematic token', (t) => { | ||||
|   // eslint-disable-next-line max-len | ||||
|   const str = 'eyJpYXQiOjE1ODE0NDAwMTIyODgsIm9iaiI6eyJpZCI6MX19.24ZOsWrnfkNe%2FbM0r7DaVJMqE2bfn2aAM%2BZSzWeSf31OCTlXXNWD34RBL2X5v3UliYQ4IIsLNBFbaW9texPHug%3D%3D'; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user