sindresorhus / dark-mode

Control the macOS dark mode from the command-line
MIT License
657 stars 28 forks source link

Fix tests #12

Open sindresorhus opened 5 years ago

sindresorhus commented 5 years ago

Issuehunt badges

Tests are failing locally on and on Travis.

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

IssueHuntBot commented 5 years ago

@issuehunt has funded $40.00 to this issue.


g1eny0ung commented 5 years ago

@sindresorhus I found this issue in issueHunt and I tried to solve it. Through logging the test, I found the AppleScript fail to run:

{
    NSAppleScriptErrorAppName = "System Events";
    NSAppleScriptErrorBriefMessage = "Not authorized to send Apple events to System Events.";
    NSAppleScriptErrorMessage = "Not authorized to send Apple events to System Events.";
    NSAppleScriptErrorNumber = "-1743";
    NSAppleScriptErrorRange = "NSRange: {71, 9}";
}

After trying many ways, I found some info in macOS Mojave 10.14 Release, it says:

image

Seems that now in macOS 10.14 and Xcode 10.2, the Xcode unit test has no permissions to execute AppleScript.

And I also view the travis CI Documantation, the xcode10.2 of osx_image was bundled with macOS 10.14.

image

So I think that's the reason why the locally and the CI tests are all fails.

jduo commented 4 years ago

Hi @sindresorhus , is this issue still in need of help?