Skip to content

Commit

Permalink
fix(tests): fix appx tests (maker did not return output path)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed May 20, 2017
1 parent b344618 commit 8d895cf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"author": "Samuel Attard",
"license": "MIT",
"devDependencies": {
"asar": "^0.13.0",
"babel-eslint": "^7.0.0",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-syntax-async-functions": "^6.13.0",
Expand Down
2 changes: 2 additions & 0 deletions src/makers/win32/appx.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ export default async ({ dir, appName, targetArch, forgeConfig, packageJSON }) =>
delete opts.makeVersionWinStoreCompatible;

await windowsStore(opts);

return [path.resolve(outPath, `${opts.packageName}.appx`)];
};
12 changes: 9 additions & 3 deletions test/slow/api_spec_slow.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { execSync } from 'child_process';
import asar from 'asar';
import fs from 'fs-extra';
import os from 'os';
import path from 'path';
Expand Down Expand Up @@ -197,6 +198,10 @@ describe(`electron-forge API (with installer=${installer.substr(12)})`, () => {
});

it('can package without errors', async () => {
const packageJSON = await readPackageJSON(dir);
packageJSON.config.forge.electronPackagerConfig.asar = true;
await fs.writeFile(path.resolve(dir, 'package.json'), JSON.stringify(packageJSON, null, 2));

await forge.package({ dir });
});

Expand All @@ -207,9 +212,10 @@ describe(`electron-forge API (with installer=${installer.substr(12)})`, () => {
}

it('should have deleted the forge config from the packaged app', async () => {
const cleanPackageJSON = await readPackageJSON(
path.resolve(dir, 'out', `Test App-${process.platform}-${process.arch}`, resourcesPath, 'app')
);
const cleanPackageJSON = JSON.parse(asar.extractFile(
path.resolve(dir, 'out', `Test App-${process.platform}-${process.arch}`, resourcesPath, 'app.asar'),
'package.json'
));
expect(cleanPackageJSON).to.not.have.deep.property('config.forge');
});

Expand Down

0 comments on commit 8d895cf

Please sign in to comment.