Skip to content
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

mock remote.nativeTheme for tests #9709

Merged
merged 1 commit into from
May 7, 2020
Merged

Conversation

outofambit
Copy link
Contributor

closes #9699
supersedes #9700

Description

adds a jest mock for remote.nativeTheme

i opted for this approach to ensure we don't affect non-test environment behavior (even though that is highly unlikely). we already mock other parts of the electron api for tests, so this also follows that approach.

(i tried this out in #9680 to make sure it worked. the tests are still failing there but for a different reason now, so WIN 😛)

cc @shiftkey @dennisameling

@outofambit outofambit added the infrastructure Issues and pull requests related to scripts and tooling for GitHub Desktop label May 5, 2020
@shiftkey
Copy link
Member

shiftkey commented May 5, 2020

👍 I poked at what this resolves to on Linux and it seems to be a real object with those functions attached - making the tests reflect that is probably The Best Way To Fix This™

Copy link
Member

@say25 say25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly what I was thinking. Was going to basically open something like this later tonight 😄

Copy link
Contributor

@dennisameling dennisameling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix!! Thanks @outofambit! 😄 🎉 Just tested on Windows 10 1909 and works as expected 👍

Copy link
Contributor

@rafeca rafeca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@outofambit outofambit merged commit 7fca28e into development May 7, 2020
@outofambit outofambit deleted the chore/mock-native-theme branch May 7, 2020 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Issues and pull requests related to scripts and tooling for GitHub Desktop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests failing on Windows > 10.0.17666 (nativeTheme undefined)
5 participants