Add test for disposing active evaluations
This commit is contained in:
@@ -5,11 +5,12 @@ import { Server, ServerOptions } from "../src/node/server";
|
||||
export const createClient = (serverOptions?: ServerOptions): Client => {
|
||||
const s2c = new Emitter<Uint8Array | Buffer>();
|
||||
const c2s = new Emitter<Uint8Array | Buffer>();
|
||||
const closeCallbacks = <Array<() => void>>[];
|
||||
|
||||
// tslint:disable-next-line
|
||||
// tslint:disable-next-line no-unused-expression
|
||||
new Server({
|
||||
close: (): void => undefined,
|
||||
onClose: (): void => undefined,
|
||||
close: (): void => closeCallbacks.forEach((cb) => cb()),
|
||||
onClose: (cb: () => void): number => closeCallbacks.push(cb),
|
||||
onMessage: (cb): void => {
|
||||
c2s.event((d) => cb(d));
|
||||
},
|
||||
@@ -17,8 +18,8 @@ export const createClient = (serverOptions?: ServerOptions): Client => {
|
||||
}, serverOptions);
|
||||
|
||||
const client = new Client({
|
||||
close: (): void => undefined,
|
||||
onClose: (): void => undefined,
|
||||
close: (): void => closeCallbacks.forEach((cb) => cb()),
|
||||
onClose: (cb: () => void): number => closeCallbacks.push(cb),
|
||||
onMessage: (cb): void => {
|
||||
s2c.event((d) => cb(d));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user