1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

pass rest session creator to scenario

This commit is contained in:
Bruno Windels
2018-09-11 14:46:25 +02:00
parent 98aafd6abb
commit afc678fea0
2 changed files with 13 additions and 2 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
const assert = require('assert');
const RiotSession = require('./src/session');
const scenario = require('./src/scenario');
const RestSessionFactory = require('./src/rest/factory');
const program = require('commander');
program
@ -40,6 +41,16 @@ async function runTests() {
options.executablePath = path;
}
const restFactory = new RestSessionFactory(
'synapse/installations/consent',
'http://localhost:5005',
__dirname
);
function createRestSession(username, password) {
return restFactory.createSession(username, password);
}
async function createSession(username) {
const session = await RiotSession.create(username, options, program.riotUrl);
sessions.push(session);
@ -48,7 +59,7 @@ async function runTests() {
let failure = false;
try {
await scenario(createSession);
await scenario(createSession, createRestSession);
} catch(err) {
failure = true;
console.log('failure: ', err);