Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Update shell.openExternal to promise due to electron update on atom #2625

Merged
merged 2 commits into from
Feb 12, 2021

Conversation

sadick254
Copy link
Contributor

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.

Description of the Change

There are some Electron APIs that changed to only return Promises (and not run callbacks passed to them), mostly as of Electron 7+. Updating to be compatible with those would be great for updating Atom's Electron version.

Screenshot or Gif

Applicable Issues

#2624

@codecov
Copy link

codecov bot commented Feb 11, 2021

Codecov Report

Merging #2625 (4ab44f3) into master (044931d) will increase coverage by 0.01%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2625      +/-   ##
==========================================
+ Coverage   93.45%   93.46%   +0.01%     
==========================================
  Files         237      237              
  Lines       13234    13215      -19     
  Branches     1906     1900       -6     
==========================================
- Hits        12368    12352      -16     
+ Misses        866      863       -3     
Impacted Files Coverage Δ
lib/controllers/issueish-searches-controller.js 89.47% <50.00%> (+8.52%) ⬆️
lib/controllers/issueish-list-controller.js 77.77% <100.00%> (-2.23%) ⬇️
lib/controllers/remote-controller.js 100.00% <100.00%> (ø)
lib/views/actionable-review-view.js 100.00% <100.00%> (ø)
lib/views/issueish-link.js 81.25% <100.00%> (-2.09%) ⬇️
lib/atom/gutter.js 92.85% <0.00%> (+2.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 044931d...4ab44f3. Read the comment docs.

@sadick254 sadick254 force-pushed the update-electron-apis branch 2 times, most recently from ecf308b to d08bb7b Compare February 11, 2021 06:23
Copy link
Contributor

@smashwilson smashwilson left a comment

Choose a reason for hiding this comment

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

Hmm CodeCov is complaining about these... they must not be covered by existing tests. I think that's probably not worth addressing here, though, because these methods don't do anything but call two other functions that we'd need to stub anyway.

lib/controllers/issueish-list-controller.js Outdated Show resolved Hide resolved
@smashwilson
Copy link
Contributor

Looks like we'll need to update the stubbing in some tests, too.

@sadick254 sadick254 force-pushed the update-electron-apis branch 4 times, most recently from 5e165e6 to 9678921 Compare February 12, 2021 07:09
Copy link
Contributor

@smashwilson smashwilson left a comment

Choose a reason for hiding this comment

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

@@ -90,15 +90,15 @@ describe('IssueishListController', function() {

it('calls shell.openExternal with specified url', async function() {
const wrapper = shallow(buildApp());
sinon.stub(shell, 'openExternal').callsArg(2);
sinon.stub(shell, 'openExternal').callsFake(() => { });
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these could also be .returns(Promise.resolve()). No big deal though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants