Skip to content

Commit

Permalink
test: add test for detect forge.config (#3031)
Browse files Browse the repository at this point in the history
  • Loading branch information
VerteDinde authored Oct 31, 2022
1 parent b80a275 commit 0986c7d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/api/core/test/fast/resolve-dir_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ describe('resolve-dir', () => {
expect(await resolveDir('/foo/var/fake')).to.be.equal(null);
});

it('should return a directory if a forge config is found, but no package.json.forge.config', async () => {
expect(await resolveDir(path.resolve(__dirname, '../fixture/forge-config-no-package-json-config/'))).to.not.be.equal(null);
expect(await resolveDir(path.resolve(__dirname, '../fixture/forge-config-no-package-json-config/'))).to.be.equal(
path.resolve(__dirname, '../fixture/forge-config-no-package-json-config')
);
});

it('should return a directory if it finds a node module', async () => {
expect(await resolveDir(path.resolve(__dirname, '../fixture/dummy_app/foo'))).to.not.be.equal(null);
expect(await resolveDir(path.resolve(__dirname, '../fixture/dummy_app/foo'))).to.be.equal(path.resolve(__dirname, '../fixture/dummy_app'));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
packagerConfig: {},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "test",
"devDependencies": {
"electron": "^1000.0.0",
"@electron-forge/cli": "6.0.0"
}
}

0 comments on commit 0986c7d

Please sign in to comment.