fix sesamefilter default
This commit is contained in:
+12
-37
@@ -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()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user