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

Commit 9893c16

Browse files
committed
fixed assertions
1 parent 233cb02 commit 9893c16

File tree

1 file changed

+10
-51
lines changed

1 file changed

+10
-51
lines changed

test/editor-binding.test.js

Lines changed: 10 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ const {FollowState} = require('@atom/teletype-client')
1717
const FakeBufferProxy = require('./helpers/fake-buffer-proxy')
1818
const BufferBinding = require('../lib/buffer-binding')
1919

20-
/*
21-
We are currently checking if teletype is trying to build against the dev version of atom which uses electron 5.
22-
This is because there is a slight change in electron 5s API and some of the assertions in this tests need to be
23-
changed. The stable and beta version of atom still uses electron 4 inorder to support both electron
24-
versions, the assertions need to be made accordingly. In the future when stable and beta start compiling against
25-
electron 5, these assertions will be simplified.
26-
*/
27-
const appName = atom.getAppName().toLowerCase()
28-
const isDevOrBetaBuild = appName.indexOf('atom dev') > -1 || appName.indexOf('atom beta') > -1
29-
3020
suite('EditorBinding', function () {
3121
if (process.env.CI) this.timeout(process.env.TEST_TIMEOUT_IN_MS)
3222

@@ -108,31 +98,20 @@ suite('EditorBinding', function () {
10898

10999
const cursorDecoratedRanges = getCursorDecoratedRanges(editor)
110100

111-
if (isDevOrBetaBuild) {
112-
return assert.deepEqual(
113-
cursorDecoratedRanges,
114-
[
115-
{tail: Point(10, 0), head: Point(11, 4)},
116-
{tail: Point(20, 5), head: Point(20, 0)},
117-
{tail: Point(3, 0), head: Point(4, 2)},
118-
{tail: Point(6, 0), head: Point(5, 0)}
119-
]
120-
)
121-
}
122-
123101
assert.deepEqual(
124102
cursorDecoratedRanges,
125103
[
126-
{tail: {row: 3, column: 0}, head: {row: 4, column: 2}},
127-
{tail: {row: 6, column: 0}, head: {row: 5, column: 0}},
128-
{tail: {row: 10, column: 0}, head: {row: 11, column: 4}},
129-
{tail: {row: 20, column: 5}, head: {row: 20, column: 0}}
104+
{tail: Point(10, 0), head: Point(11, 4)},
105+
{tail: Point(20, 5), head: Point(20, 0)},
106+
{tail: Point(3, 0), head: Point(4, 2)},
107+
{tail: Point(6, 0), head: Point(5, 0)}
130108
]
131109
)
132110

133111
editor.setSelectedBufferRanges([
134112
[[0, 0], [0, 4]]
135113
])
114+
136115
assert.deepEqual(
137116
editorProxy.selections,
138117
{
@@ -164,22 +143,12 @@ suite('EditorBinding', function () {
164143

165144
const cursorDecoratedRanges = getCursorDecoratedRanges(editor)
166145

167-
if (isDevOrBetaBuild) {
168-
return assert.deepEqual(
169-
cursorDecoratedRanges,
170-
[
171-
{tail: Point(10, 0), head: Point(11, 4)},
172-
{tail: Point(20, 0), head: Point(20, 5)},
173-
{tail: Point(3, 0), head: Point(4, 2)}
174-
]
175-
)
176-
}
177146
assert.deepEqual(
178147
cursorDecoratedRanges,
179148
[
180-
{tail: {row: 3, column: 0}, head: {row: 4, column: 2}},
181-
{tail: {row: 10, column: 0}, head: {row: 11, column: 4}},
182-
{tail: {row: 20, column: 0}, head: {row: 20, column: 5}}
149+
{tail: Point(10, 0), head: Point(11, 4)},
150+
{tail: Point(20, 0), head: Point(20, 5)},
151+
{tail: Point(3, 0), head: Point(4, 2)}
183152
]
184153
)
185154

@@ -267,21 +236,11 @@ suite('EditorBinding', function () {
267236

268237
const cursorDecoratedRanges = getCursorDecoratedRanges(editor)
269238

270-
if (isDevOrBetaBuild) {
271-
return assert.deepEqual(
272-
cursorDecoratedRanges,
273-
[
274-
{tail: Point(0, 3), head: Point(0, 3)},
275-
{tail: Point(0, 6), head: Point(0, 6)}
276-
]
277-
)
278-
}
279-
280239
assert.deepEqual(
281240
cursorDecoratedRanges,
282241
[
283-
{tail: {row: 0, column: 6}, head: {row: 0, column: 6}},
284-
{tail: {row: 0, column: 3}, head: {row: 0, column: 3}}
242+
{tail: Point(0, 3), head: Point(0, 3)},
243+
{tail: Point(0, 6), head: Point(0, 6)}
285244
]
286245
)
287246
})

0 commit comments

Comments
 (0)