Skip to content
Permalink
Browse files

fix(tests): make optionFetcher-related tests compile again

  • Loading branch information
malept authored and MarshallOfSound committed Apr 7, 2017
1 parent fbaec97 commit 1097f8bd1a39c6af9af85fb91d45579ee8dff678
Showing with 17 additions and 13 deletions.
  1. +17 −13 test/slow/api_spec_slow.js
@@ -232,7 +232,7 @@ describe(`electron-forge API (with installer=${installer.substr(12)})`, () => {
await fs.writeFile(path.resolve(dir, 'package.json'), JSON.stringify(packageJSON));
});

options.forEach((optionsFetcher) => {
for (const optionsFetcher of options) {
if (shouldPass) {
it(`successfully makes for config: ${JSON.stringify(optionsFetcher(), 2)}`, async () => {
await forge.make(optionsFetcher());
@@ -242,24 +242,28 @@ describe(`electron-forge API (with installer=${installer.substr(12)})`, () => {
await expect(forge.make(optionsFetcher())).to.eventually.be.rejected;
});
}
});
}
});
};

[].concat(targets).concat(genericTargets).forEach((target) => {
const testOptions = [() => ({ dir, skipPackage: true })];
testMakeTarget(target, true, ...testOptions);
});
const targetOptionFetcher = () => ({ dir, skipPackage: true });
for (const target of [].concat(targets).concat(genericTargets)) {
testMakeTarget(target, true, targetOptionFetcher);
}

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

const dummyMakerPath = `${process.cwd()}/test/fixture/dummy-maker`;
testMakeTarget('dummy', false, {
dir,
overrideTargets: [dummyMakerPath],
platform: process.platform === 'darwin' ? 'linux' : 'darwin',
skipPackage: true,
});
const dummyOptionFetcher = () => (
{
dir,
overrideTargets: [dummyMakerPath],
platform: process.platform === 'darwin' ? 'linux' : 'darwin',
skipPackage: true,
}
);

testMakeTarget('dummy', false, dummyOptionFetcher);
});

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

0 comments on commit 1097f8b

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