Skip to content

Commit

Permalink
test(import): check if electron-quick-start packages (#3580)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao committed Apr 26, 2024
1 parent b298b29 commit 84eb775
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/api/core/test/slow/api_spec_slow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,30 @@ for (const nodeInstaller of ['npm', 'yarn']) {
before(async () => {
dir = await ensureTestDirIsNonexistent();
await fs.mkdir(dir);
execSync(`${nodeInstaller} init -y`, {
execSync(`git clone https://github.com/electron/electron-quick-start.git . --quiet`, {
cwd: dir,
});
});

it('creates a forge config', async () => {
it('creates forge.config.js and is packageable', async () => {
await updatePackageJSON(dir, async (packageJSON) => {
packageJSON.name = 'Name';
packageJSON.productName = 'Product Name';
packageJSON.customProp = 'propVal';
packageJSON.productName = 'ProductName';
});

await forge.import({ dir });

const { customProp } = await readRawPackageJson(dir);
expect(fs.existsSync(path.join(dir, 'forge.config.js'))).to.equal(true);

expect(customProp).to.equal('propVal');
execSync(`${nodeInstaller} install`, {
cwd: dir,
});

await forge.package({ dir });

const outDirContents = fs.readdirSync(path.join(dir, 'out'));
expect(outDirContents).to.have.length(1);
expect(outDirContents[0]).to.equal(`ProductName-${process.platform}-${process.arch}`);
});

after(async () => {
Expand Down

0 comments on commit 84eb775

Please sign in to comment.