-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Migrating to Electron 28 #1054
Draft
araujoarthur0
wants to merge
15
commits into
thamara:main
Choose a base branch
from
araujoarthur0:electron-28
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
araujoarthur0
force-pushed
the
electron-28
branch
from
January 13, 2024 12:01
6ec971d
to
4f4534b
Compare
araujoarthur0
force-pushed
the
electron-28
branch
2 times, most recently
from
January 25, 2024 02:13
ace65ac
to
a990409
Compare
I will make a separate PR changing the tests to use node's |
I'm converting this to draft, until the tests have been cleared and this can be rebased, ok @araujoarthur0 ? |
araujoarthur0
force-pushed
the
electron-28
branch
from
March 17, 2024 23:01
1b4c6f6
to
51e3aea
Compare
Migrating menus test
araujoarthur0
force-pushed
the
electron-28
branch
from
March 17, 2024 23:57
51e3aea
to
3892d4f
Compare
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.
Related issue
Closes #1037
Context / Background
The new electron 28 changes things by providing main electron imports through JS modules. That means we'll be able to use
import
syntax rather than node'srequire()
, and no longer need theesm
module to use both notations.The
require()
notation will still be available, making it the best of both worlds for other imports that haven't migrated yet - date-holidays for example.This patch follows #1050 in which I cleaned some things in preparation.
What change is being introduced by this PR?
expect
to node's built-inassert
. Notations differ a bit, but the preferred way is to useassert.strictEqual()
.assert.equal()
seems to be legacy.jest.mock()
to sinon's spies and stubs, which help a lot and have some similar usages.MockClass
object that allows us to mock some files from within. The methods that have to be mocked are diverted before being exported into this class, and it allows us to switch the method to a stub directly from other pieces of code, which switches the method used in other files as well.Spectron
, which is long deprecated. I switched its implementation to use Playwright, which has an Electron module that does pretty much what Spectron did. It is quite flaky though, and the tests work randomly.I am sending this PR as a call for help to finish migrating our tests. We have too much content to migrate and I'll probably take a long time to do it alone.
The way I'm running tests right now is for example
npx electron-mocha .\__tests__\__main__\notification.mjs
.Later on we can change our package.json targets.
How will this be tested?
Hopefully soon by electron-mocha.