mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
26 lines
574 B
TypeScript
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";
|