-
Notifications
You must be signed in to change notification settings - Fork 276
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
Migrating to Electron 28 #1054
Migrating to Electron 28 #1054
Conversation
6ec971d
to
4f4534b
Compare
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 ? |
51e3aea
to
3892d4f
Compare
4466f98
to
0b92f84
Compare
bd633cb
to
ed8db0b
Compare
57d3ad7
to
629f61c
Compare
629f61c
to
0ed67c9
Compare
bfea76a
to
d61d80d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems to be working just fine, both apps & tests. Great work!
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.How will this be tested?
By the migrated tests themselves passing.