test: add end-to-end tests for create-electron-app across all templates and package managers#4218
Open
test: add end-to-end tests for create-electron-app across all templates and package managers#4218
create-electron-app across all templates and package managers#4218Conversation
5be8b3d to
f01f2e0
Compare
fix(template-base): use `main` instead of `exports` for the main process entrypoint in `package.json` Adds tests that check if a template is correctly created under different package managers and if its main process entrypoint and preload file are correctly loaded. Also fixes the entrypoint for `template-base`.
…ectron-forge start`
ed1ad42 to
e7850b0
Compare
create-electron-app across all templates and package managers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summarize your changes:
This allows us to catch any issues when creating a project with
create-electron-appusing any Forge template and any supported package manager, and also fixes one such issue I found in@electron-forge/template-basewhen testing this locally (we hadexportsinstead ofmaininpackage.json, so Electron would fail to find the project's entrypoint).create-electron-appalways generates CommonJS projects, so this doesn't test ESM projects for now since a programmatic conversion of the project files (or actually creating ESM projects natively through a CLI flag or something) would be non-trivial enough to warrant a separate PR.As a stopgap solution until our ESM story for templates is clearer, I've added a
moduleFormatsoption to the test suite so that we can pick whether we want to test CommonJS, ESM, or both; this way, we can manually edit the template files in our local checkout to make any changes required for ESM to work and run the test using the local version installed through Verdaccio. This should allow us to test @erickzhao's changes in #4184 more easily.