From f1d42f540552602317411e6030da9a1832e9cff7 Mon Sep 17 00:00:00 2001 From: Maciej Kucharz Date: Fri, 19 Jan 2018 16:33:16 +0100 Subject: [PATCH] fix(hosting): error while syncing again (#83) * fix(hosting): error while syncing again * fix(e2e): add proper es6 env for config test case --- packages/cli/src/utils/hosting/hosting.js | 4 ++-- .../cli/tests/e2e/assets/sockets/hello-config/socket.yml | 1 + packages/cli/tests/e2e/hosting.test-e2e.js | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/utils/hosting/hosting.js b/packages/cli/src/utils/hosting/hosting.js index 9b35b8c4..223b2024 100644 --- a/packages/cli/src/utils/hosting/hosting.js +++ b/packages/cli/src/utils/hosting/hosting.js @@ -396,10 +396,10 @@ class Hosting { async listRemoteFiles () { debug('listRemoteFiles()') const files = await session.connection.hosting.listFiles(this.name) - return files.map(async file => { + return Promise.all(files.map(async file => { const hostingFile = new HostingFile(file) return hostingFile.loadRemote(file) - }) + })) } // Get info about hostings first, then get the files list for given one diff --git a/packages/cli/tests/e2e/assets/sockets/hello-config/socket.yml b/packages/cli/tests/e2e/assets/sockets/hello-config/socket.yml index 1bf34623..7d7a7219 100644 --- a/packages/cli/tests/e2e/assets/sockets/hello-config/socket.yml +++ b/packages/cli/tests/e2e/assets/sockets/hello-config/socket.yml @@ -1,6 +1,7 @@ name: hello-config description: Socket for cheching config functionality version: 0.0.1 +runtime: nodejs_v8 config: TEST1: diff --git a/packages/cli/tests/e2e/hosting.test-e2e.js b/packages/cli/tests/e2e/hosting.test-e2e.js index 03712d40..a9adf958 100644 --- a/packages/cli/tests/e2e/hosting.test-e2e.js +++ b/packages/cli/tests/e2e/hosting.test-e2e.js @@ -82,8 +82,13 @@ describe('[E2E] CLI Hosting', function () { it('can sync local hosting', function (done) { testNixt() .run(`${cliLocation} hosting sync ${hostingName}`) - .on(/Choose socket in which you want to set up hosting/) - .respond('\n') + .stdout(/files synchronized/) + .end(done) + }) + + it('can sync local hosting again', function (done) { + testNixt() + .run(`${cliLocation} hosting sync ${hostingName}`) .stdout(/files synchronized/) .end(done) })