Skip to content

Commit

Permalink
Try to test build-installer
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtkowiak committed Sep 27, 2018
1 parent 8d57559 commit 25d5134
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ class MeteorDesktop {
this.meteorApp.updateGitIgnore();
}

async buildInstaller() {
async buildInstaller(throwError = false) {
this.env.options.installerBuild = true;
await this.electronApp.build();
try {
await this.electronBuilder.build();
} catch (e) {
this.log.error('error occurred while building installer', e);
if (throwError) {
throw new Error(e);
}
}
}

Expand Down
30 changes: 30 additions & 0 deletions tests/integration/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,36 @@ describe('desktop', () => {
expect(result.value).to.equal(1);
}).timeout(10 * 60000);

it('should build installer', async () => {
MeteorDesktop = meteorDesktop(
appDir,
appDir,
{
ddpUrl: 'http://127.0.0.1:3080',
build: true,
output: appDir,
scaffold: true,
skipMobileBuild: true,
forceCordovaBuild: true,
skipRemoveMobilePlatform: true
}
);

if (fs.existsSync(path.join(appDir, MeteorDesktop.env.paths.installerDir))) {
shell.rm('-rf', MeteorDesktop.env.paths.installerDir);
}

// Build the installer.
try {
await MeteorDesktop.buildInstaller(true);
} catch (e) {
throw new Error(e);
}
// For now we are just making an assumption that it went ok if it did not throw an error.

expect(fs.existsSync(path.join(appDir, MeteorDesktop.env.paths.installerDir))).to.be.true();
}).timeout(10 * 60000);

if (process.env.TRAVIS || process.env.APPVEYOR) {
it('should build with -b', async () => {
MeteorDesktop = meteorDesktop(
Expand Down

0 comments on commit 25d5134

Please sign in to comment.