spec/integ/megolm-integ.spec.js
function createOlmSession(olmAccount, recipientTestClient) {
    return recipientTestClient.awaitOneTimeKeyUpload().then((keys) => {
        const otkId = utils.keys(keys)[0];
        const otk = keys[otkId];

        const session = new global.Olm.Session();
        session.create_outbound(
            olmAccount, recipientTestClient.getDeviceKey(), otk.key,
        );
        return session;
    });
}
function createOlmSession(olmAccount, recipientTestClient) {
    return recipientTestClient.awaitOneTimeKeyUpload().then((keys) => {
        const otkId = utils.keys(keys)[0];
        const otk = keys[otkId];

        const session = new global.Olm.Session();
        session.create_outbound(
            olmAccount, recipientTestClient.getDeviceKey(), otk.key,
        );
        return session;
    });
}
function createOlmSession ( olmAccount , recipientTestClient ) { return recipientTestClient . awaitOneTimeKeyUpload ( ) . then ( ( keys ) => { const otkId = utils . keys ( keys ) [ 0 ] ; const otk = keys [ otkId ] ; const session = new global . Olm . Session ( ) ; session . create_outbound ( olmAccount , recipientTestClient . getDeviceKey ( ) , otk . key , ) ; return session ; } ) ; }
start an Olm session with a given recipient

@param {Olm.Account} olmAccount
@param {TestClient} recipientTestClient
@return {Promise} promise for Olm.Session
start an Olm session with a given recipient