spec/integ/matrix-client-crypto.spec.js
/**
 * Set http responses for the requests which are made when a client starts, and
 * start the client.
 *
 * @param {object} httpBackend
 * @param {MatrixClient} client
 */
Set http responses for the requests which are made when a client starts, and
start the client.

@param {object} httpBackend
@param {MatrixClient} client
Set http responses for the requests which are made when a client starts and start the client . @param { object } httpBackend @param { MatrixClient } client
function startClient(httpBackend, client) {
    httpBackend.when("GET", "/pushrules").respond(200, {});
    httpBackend.when("POST", "/filter").respond(200, { filter_id: "fid" });
    const syncData = {
        next_batch: "x",
        rooms: {
            join: { },
        },
    };
    syncData.rooms.join[roomId] = {
        state: {
            events: [
                testUtils.mkMembership({
                    mship: "join",
                    user: aliUserId,
                }),
                testUtils.mkMembership({
                    mship: "join",
                    user: bobUserId,
                }),
            ],
        },
        timeline: {
            events: [],
        },
    };
    httpBackend.when("GET", "/sync").respond(200, syncData);
    client.startClient();
}
function startClient ( httpBackend , client ) { httpBackend . when ( "GET" , "/pushrules" ) . respond ( 200 , { } ) ; httpBackend . when ( "POST" , "/filter" ) . respond ( 200 , { filter_id : "fid" } ) ; const syncData = { next_batch : "x" , rooms : { join : { } , } , } ; syncData . rooms . join [ roomId ] = { state : { events : [ testUtils . mkMembership ( { mship : "join" , user : aliUserId , } ) , testUtils . mkMembership ( { mship : "join" , user : bobUserId , } ) , ] , } , timeline : { events : [ ] , } , } ; httpBackend . when ( "GET" , "/sync" ) . respond ( 200 , syncData ) ; client . startClient ( ) ; }
Set http responses for the requests which are made when a client starts, and
 start the client.
Set http responses for the requests which are made when a client starts and start the client .
// send a sync response including our test room.