Skip to content

Commit

Permalink
Add test for the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Dec 4, 2017
1 parent 468fc7d commit a3ffe36
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions test/slow/api_spec_slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const forge = proxyquire.noCallThru().load('../../src/api', {
'./install': async () => {},
});

describe(`electron-forge API (with nodeInstaller=${nodeInstaller})`, () => {
describe(`electron-forge API (with installer=${nodeInstaller})`, () => {
let dir;
let dirID = Date.now();

Expand Down Expand Up @@ -172,7 +172,7 @@ describe(`electron-forge API (with nodeInstaller=${nodeInstaller})`, () => {
packageJSON.name = 'Name';
packageJSON.productName = 'Product Name';
packageJSON.customProp = 'propVal';
await fs.writeFile(path.resolve(dir, 'package.json'), JSON.stringify(packageJSON, null, 2));
await fs.writeJson(path.resolve(dir, 'package.json'), packageJSON);

await forge.import({ dir });

Expand All @@ -191,6 +191,27 @@ describe(`electron-forge API (with nodeInstaller=${nodeInstaller})`, () => {
expect(customProp).to.equal('propVal');
});

it('defaults windowsStoreConfig.name to packageJSON.name', async () => {
const packageJSON = await readPackageJSON(dir);
packageJSON.name = 'Name';
delete packageJSON.productName;
await fs.writeJson(path.resolve(dir, 'package.json'), packageJSON);

await forge.import({ dir });

const {
config: {
forge: {
electronWinstallerConfig: { name: winstallerName },
windowsStoreConfig: { name: windowsStoreName },
},
},
} = await readPackageJSON(dir);

expect(winstallerName).to.equal('Name');
expect(windowsStoreName).to.equal('Name');
});

after(async () => {
await fs.remove(dir);
});
Expand Down

0 comments on commit a3ffe36

Please sign in to comment.