Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcctech committed Aug 11, 2023
1 parent 95f724b commit bb250b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/functional/modules/autoupdate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
});
});
});
10 changes: 10 additions & 0 deletions tests/helpers/autoupdate/meteorServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
{});
Expand Down

0 comments on commit bb250b7

Please sign in to comment.