diff --git a/test/e2e/cht-conf-utils.js b/test/e2e/cht-conf-utils.js index 9a320f06..e60c9ab0 100644 --- a/test/e2e/cht-conf-utils.js +++ b/test/e2e/cht-conf-utils.js @@ -10,8 +10,7 @@ const getProjectDirectory = (projectName = DEFAULT_PROJECT_NAME) => path.resolve const runChtConf = async ( command, - { url, sessionToken } = {}, - projectName = DEFAULT_PROJECT_NAME + { url, sessionToken, projectName = DEFAULT_PROJECT_NAME } = {}, ) => { const instanceUrl = url || await getProjectUrl(projectName); const sessionParam = sessionToken ? `--session-token=${sessionToken}` : ''; @@ -56,7 +55,7 @@ const initProject = async (projectName = DEFAULT_PROJECT_NAME) => { }, null, 4), ); - await runChtConf('initialise-project-layout', projectName); + await runChtConf('initialise-project-layout', { projectName }); }; const writeBaseAppSettings = async (baseSettings, projectName = DEFAULT_PROJECT_NAME) => { diff --git a/test/e2e/session-token.spec.js b/test/e2e/session-token.spec.js index 67f93d82..661236c6 100644 --- a/test/e2e/session-token.spec.js +++ b/test/e2e/session-token.spec.js @@ -10,7 +10,7 @@ const { getProjectDirectory, runChtConf, } = require('./cht-conf-utils'); -const COUCH_URL_PATTERN = /^(https?:\/\/)([^:]+):([^@]+)@(.*)$/; +const COUCH_URL_PATTERN = /^(?https?:\/\/)(?[^:]+):(?[^@]+)@(?.*)$/; const projectPath = getProjectDirectory(); @@ -68,7 +68,7 @@ describe('session-token', () => { await createProjectPath(); initializeDatabase(); authenticatedUrl = await getProjectUrl(); - const [, prefix, user, password, rootUrl] = authenticatedUrl.match(COUCH_URL_PATTERN); + const { prefix, user, password, rootUrl } = authenticatedUrl.match(COUCH_URL_PATTERN).groups; unauthenticatedUrl = `${prefix}${rootUrl}`; sessionToken = await getSessionToken(user, password); }); diff --git a/test/fn/compile-app-settings.spec.js b/test/fn/compile-app-settings.spec.js index 56abd5e7..b987140a 100644 --- a/test/fn/compile-app-settings.spec.js +++ b/test/fn/compile-app-settings.spec.js @@ -158,6 +158,6 @@ describe('compile-app-settings', () => { .excludingEvery(['rules', 'contact_summary']) .to.deep.eq(expected); } - }).timeout(4000); + }); } }); diff --git a/test/fn/watch-project.spec.js b/test/fn/watch-project.spec.js index a0f7b58e..2bef1a76 100644 --- a/test/fn/watch-project.spec.js +++ b/test/fn/watch-project.spec.js @@ -152,7 +152,7 @@ describe('watch-project', () => { .then(mockApi.getAppSettings) .then((settings) => JSON.parse(settings.content)) .then((settings) => expect(settings.locale).equal('es')); - }).timeout(16000); + }); it('watch-project: convert app settings', () => { const appSettingsPath = path.join(testDir, 'app_settings.json'); @@ -178,7 +178,7 @@ describe('watch-project', () => { .then(messages => { assert.deepEqual(messages.custom, { a: 'first', test: 'new' }); }); - }).timeout(16000); + }); it('watch-project: upload resources', () => { return watchWrapper(editResources, 'resources.json')