fix sesamefilter default

This commit is contained in:
2020-03-05 18:48:39 +01:00
parent 42c2d4d3ec
commit bb94b1c405
3 changed files with 20 additions and 40 deletions
+12 -37
View File
@@ -316,30 +316,26 @@ describe('Sesame should unlock the socket', () => {
it('should not work without sesame', (done) => {
const sock = new RPCSocket(21004, "localhost")
sock.connect<SesameTestIfc>( /* no sesame */).then(async (cli) => {
cli.test.checkCandy().then(d => {
done(d)
}).catch(e => {
//console.log("EXPECTED CLIENT EXCEPTION", String(e));
if(!cli.test)
done()
}).finally(() => {
cli.destroy()
sock.destroy()
})
else{
done(new Error("Function supposed to be removed without sesame"))
}
cli.destroy()
sock.destroy()
})
})
it('should fail with wrong sesame', (done) => {
const sock = new RPCSocket(21004, "localhost")
sock.connect<SesameTestIfc>('abasd').then(async (cli) => {
cli.test.checkCandy().then(d => {
done("should not be able to get candy")
}).catch(e => {
//console.log("EXPECTED CLIENT EXCEPTION", String(e));
if(!cli.test)
done()
}).finally(() => {
sock.destroy()
cli.destroy()
})
else{
done(new Error("Function supposed to be removed without sesame"))
}
cli.destroy()
sock.destroy()
})
})
@@ -355,27 +351,6 @@ describe('Sesame should unlock the socket', () => {
client.test.checkCandy()
})
})
it('callback should not work without sesame', (done) => {
const sock = new RPCSocket(21004, "localhost")
sock.connect<SesameTestIfc>( /* no sesame */).then(async (cli) => {
cli.test.subscribe((c) => {
console.log("CALLBACK TRIGGERED UNEXPECTED");
if(c === candy)
done("super not")
}).then(async d => {
await client.test.checkCandy()
if(d == null){
done()
}else
done('unexpected valid response '+(d) )
}).finally(() => {
sock.destroy()
})
})
})
})