diff --git a/tests/functional/modules/autoupdate.test.js b/tests/functional/modules/autoupdate.test.js index 6ef39cc2..b2eff7f1 100644 --- a/tests/functional/modules/autoupdate.test.js +++ b/tests/functional/modules/autoupdate.test.js @@ -960,16 +960,16 @@ describe('autoupdate', () => { shutdownLocalServer(); }); - it('is set to false then should not emit new version', async (done) => { + it('is set to false then should not emit new version', (done) => { const timeout = waitForTestToFail(1000, done); - await runAutoUpdateTests(done, () => { + runAutoUpdateTests(done, () => { clearTimeout(timeout); done('onVersionReady invoked unexpectedly'); }, 'version2', 'version1', true, false, true, { desktopHCP: false }); }); - it('is set to true then should emit new version', async (done) => { - await runAutoUpdateTests(done, Function.prototype, 'version2', 'version1', false, false, true, { desktopHCP: true }); + it('is set to true then should emit new version', (done) => { + runAutoUpdateTests(done, Function.prototype, 'version2', 'version1', false, false, true, { desktopHCP: true }); }); }); }); diff --git a/tests/helpers/autoupdate/meteorServer.js b/tests/helpers/autoupdate/meteorServer.js index 0875c1d8..6e0b7c79 100644 --- a/tests/helpers/autoupdate/meteorServer.js +++ b/tests/helpers/autoupdate/meteorServer.js @@ -121,6 +121,16 @@ export default class MeteorServer { server.use(setETag); + function versionDesktop(req, res, next) { + const parsedUrl = url.parse(req.url); + if (parsedUrl.pathname.endsWith('version.desktop.json')) { + const manifest = require(path.join(serverPath, 'manifest.json')) + res.end(JSON.stringify(manifest.version)); + } + next(); + } + server.use(versionDesktop); + // Serve files as static from the main directory. server.use(serveStatic(serverPath), {});