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

Commit a10a8b3

Browse files
authored
Merge pull request #1845 from atom/aw/codecov-pin
Pin codecov package to the lastest master
2 parents 91f31db + e5b50b3 commit a10a8b3

File tree

8 files changed

+223
-27
lines changed

8 files changed

+223
-27
lines changed

azure-pipelines.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
trigger:
2-
branches:
3-
include:
4-
- master
5-
- releases/*
6-
7-
pr:
8-
branches:
9-
include:
10-
- "*"
11-
121
jobs:
132
- job: Linux
143
pool:

lib/atom/atom-text-editor.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {CompositeDisposable} from 'event-kit';
55

66
import RefHolder from '../models/ref-holder';
77
import {RefHolderPropType} from '../prop-types';
8-
import {autobind, extractProps} from '../helpers';
8+
import {extractProps} from '../helpers';
99

1010
const editorUpdateProps = {
1111
mini: PropTypes.bool,
@@ -28,7 +28,7 @@ export default class AtomTextEditor extends React.Component {
2828
static propTypes = {
2929
...editorCreationProps,
3030

31-
workspace: PropTypes.object.isRequired, // FIXME make more specific
31+
workspace: PropTypes.object.isRequired,
3232

3333
didChangeCursorPosition: PropTypes.func,
3434
didAddSelection: PropTypes.func,
@@ -50,7 +50,6 @@ export default class AtomTextEditor extends React.Component {
5050

5151
constructor(props) {
5252
super(props);
53-
autobind(this, 'observeSelections');
5453

5554
this.subs = new CompositeDisposable();
5655

@@ -98,7 +97,7 @@ export default class AtomTextEditor extends React.Component {
9897
this.subs.dispose();
9998
}
10099

101-
observeSelections(selection) {
100+
observeSelections = selection => {
102101
const selectionSubs = new CompositeDisposable(
103102
selection.onDidChangeRange(this.props.didChangeSelectionRange),
104103
selection.onDidDestroy(() => {

lib/atom/decoration.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
44
import {Disposable} from 'event-kit';
55
import cx from 'classnames';
66

7-
import {createItem, autobind, extractProps} from '../helpers';
7+
import {createItem, extractProps} from '../helpers';
88
import {RefHolderPropType} from '../prop-types';
99
import {TextEditorContext} from './atom-text-editor';
1010
import {DecorableContext} from './marker';
@@ -40,8 +40,6 @@ class BareDecoration extends React.Component {
4040
constructor(props, context) {
4141
super(props, context);
4242

43-
autobind(this, 'observeParents');
44-
4543
this.decorationHolder = new RefHolder();
4644
this.editorSub = new Disposable();
4745
this.decorableSub = new Disposable();
@@ -93,7 +91,7 @@ class BareDecoration extends React.Component {
9391
}
9492
}
9593

96-
observeParents() {
94+
observeParents = () => {
9795
this.decorationHolder.map(decoration => decoration.destroy());
9896

9997
const editorValid = this.props.editorHolder.map(editor => !editor.isDestroyed()).getOr(false);

lib/models/repository-states/present.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default class Present extends State {
4343
this.commitMessageTemplate = null;
4444
this.fetchInitialMessage();
4545

46+
/* istanbul ignore else */
4647
if (history) {
4748
this.discardHistory.updateHistory(history);
4849
}
@@ -165,6 +166,7 @@ export default class Present extends State {
165166
keys.add(Keys.statusBundle);
166167
}
167168

169+
/* istanbul ignore else */
168170
if (keys.size > 0) {
169171
this.cache.invalidate(Array.from(keys));
170172
this.didUpdate();
@@ -557,6 +559,7 @@ export default class Present extends State {
557559
destructiveAction,
558560
partialDiscardFilePath,
559561
);
562+
/* istanbul ignore else */
560563
if (snapshots) {
561564
await this.saveDiscardHistory();
562565
}

package-lock.json

Lines changed: 74 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"babel-plugin-istanbul": "4.1.6",
7979
"chai": "4.1.2",
8080
"chai-as-promised": "7.1.1",
81-
"codecov": "3.1.0",
81+
"codecov": "codecov/codecov-node#e427d90",
8282
"cross-env": "5.2.0",
8383
"cross-unzip": "0.2.1",
8484
"dedent-js": "1.0.1",

test/atom/atom-text-editor.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import {mount} from 'enzyme';
2+
import {mount, shallow} from 'enzyme';
33
import {TextBuffer} from 'atom';
44

55
import RefHolder from '../../lib/models/ref-holder';
@@ -35,6 +35,12 @@ describe('AtomTextEditor', function() {
3535
assert.isTrue(workspace.isTextEditor(app.instance().refModel.get()));
3636
});
3737

38+
it('returns undefined if the current model is unavailable', function() {
39+
const emptyHolder = new RefHolder();
40+
const app = shallow(<AtomTextEditor refModel={emptyHolder} />);
41+
assert.isUndefined(app.instance().getModel());
42+
});
43+
3844
it('configures the created text editor with props', function() {
3945
mount(
4046
<AtomTextEditor

0 commit comments

Comments
 (0)