Skip to content
Permalink
Browse files

fix(maker): test outDir on zip target only, after other targets run

  • Loading branch information
anulman authored and MarshallOfSound committed Mar 13, 2017
1 parent 686200f commit a2c924992ec51b81f5ec901d9f6a40782a7619cc
Showing with 11 additions and 10 deletions.
  1. +11 −10 test/slow/api_spec_slow.js
@@ -205,24 +205,25 @@ describe(`electron-forge API (with installer=${installer.substr(12)})`, () => {
targets = fs.readdirSync(path.resolve(__dirname, `../../src/makers/${process.platform}`)).map(file => path.parse(file).name);
}
const genericTargets = fs.readdirSync(path.resolve(__dirname, '../../src/makers/generic')).map(file => path.parse(file).name);

[].concat(targets).concat(genericTargets).forEach((target) => {
describe(`make (with target=${target})`, () => {
before(async () => {
const testMakeTarget = async function testMakeTarget(target, options = {}) {
await describe(`make (with target=${target})`, async () => {
await before(async () => {
const packageJSON = await readPackageJSON(dir);
packageJSON.config.forge.make_targets[process.platform] = [target];
await fs.writeFile(path.resolve(dir, 'package.json'), JSON.stringify(packageJSON));
});

it('successfully makes with default config', async () => {
await forge.make({ dir, skipPackage: true });
});

it('successfully makes to outDir with default config', async () => {
await forge.make({ dir, outDir: `${dir}/foo`, skipPackage: true });
await it(`successfully makes for config: ${JSON.stringify(options, 2)}`, async () => {
await forge.make(options);
});
});
};

[].concat(targets).concat(genericTargets).forEach(async (target) => {
await testMakeTarget(target, { dir, skipPackage: true });
});

testMakeTarget('zip', { dir, skipPackage: true, outDir: `${dir}/foo` });
});

after(() => fs.remove(dir));

0 comments on commit a2c9249

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