Skip to content
Permalink
Browse files

fix(tests): fix appx tests (maker did not return output path)

  • Loading branch information
MarshallOfSound committed May 20, 2017
1 parent b344618 commit 8d895cfcf3779f5b82d4e6e2745424d4dffa0c9c
Showing with 12 additions and 3 deletions.
  1. +1 −0 package.json
  2. +2 −0 src/makers/win32/appx.js
  3. +9 −3 test/slow/api_spec_slow.js
@@ -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",
@@ -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`)];
};
@@ -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';
@@ -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 });
});

@@ -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');
});

0 comments on commit 8d895cf

Please sign in to comment.
You can’t perform that action at this time.