Files
socket.io/test/support/util.ts

26 lines
574 B
TypeScript

/**
* This is needed because webdriver.io does not support mocha async mode:
*
* ```
* it("works", (done) => {
* done(); // does not work
* });
* ```
*
* @see https://webdriver.io/docs/frameworks/#using-mocha
* @param fn
*/
export function wrap(fn: (done: (err?: Error) => void) => void) {
return new Promise<Error>((resolve) => fn(resolve));
}
export function success(done, socket) {
socket.disconnect();
done();
}
/**
* URL of the Socket.IO server used in the tests (see "test/support/server.ts")
*/
export const BASE_URL = "http://localhost:3210";