Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit b148e9c

Browse files
committed
Code style: fix code issues.
2 parents 1e8bf0a + ecbd5bb commit b148e9c

6 files changed

Lines changed: 43 additions & 43 deletions

File tree

src/dom/position.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function getAbsoluteRectCoordinates( { left, top } ) {
250250

251251
return {
252252
left: left + scrollX,
253-
top: top + scrollY,
253+
top: top + scrollY
254254
};
255255
}
256256

tests/config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe( 'Config', () => {
5555
it( 'should set default parameters', () => {
5656
const defaultConfig = {
5757
foo: 1,
58-
bar: 2,
58+
bar: 2
5959
};
6060

6161
config = new Config( {}, defaultConfig );
@@ -86,11 +86,11 @@ describe( 'Config', () => {
8686
it( 'passed parameters should override default parameters', () => {
8787
const defaultConfig = {
8888
foo: 1,
89-
bar: 2,
89+
bar: 2
9090
};
9191

9292
config = new Config( {
93-
foo: 10,
93+
foo: 10
9494
}, defaultConfig );
9595

9696
expect( config.get( 'foo' ) ).to.equal( 10 );
@@ -106,7 +106,7 @@ describe( 'Config', () => {
106106
b: {
107107
foo: {
108108
first: 1,
109-
second: 2,
109+
second: 2
110110
}
111111
}
112112
};

tests/difftochanges.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,41 @@ import diffToChanges from '../src/difftochanges';
88

99
describe( 'diffToChanges', () => {
1010
describe( 'equal patterns', () => {
11-
test( 0, '', '' );
12-
test( 0, 'abc', 'abc' );
11+
testDiff( 0, '', '' );
12+
testDiff( 0, 'abc', 'abc' );
1313
} );
1414

1515
describe( 'insertion', () => {
16-
test( 1, '', 'abc' );
17-
test( 1, 'abc', 'abcd' );
18-
test( 1, 'abc', 'abcdef' );
19-
test( 2, 'abc', 'xxabcyy' );
20-
test( 2, 'abc', 'axxbyyc' );
16+
testDiff( 1, '', 'abc' );
17+
testDiff( 1, 'abc', 'abcd' );
18+
testDiff( 1, 'abc', 'abcdef' );
19+
testDiff( 2, 'abc', 'xxabcyy' );
20+
testDiff( 2, 'abc', 'axxbyyc' );
2121
} );
2222

2323
describe( 'deletion', () => {
24-
test( 1, 'abc', '' );
25-
test( 1, 'abc', 'ac' );
26-
test( 1, 'abc', 'bc' );
27-
test( 1, 'abc', 'ab' );
28-
test( 1, 'abc', 'c' );
29-
test( 2, 'abc', 'b' );
24+
testDiff( 1, 'abc', '' );
25+
testDiff( 1, 'abc', 'ac' );
26+
testDiff( 1, 'abc', 'bc' );
27+
testDiff( 1, 'abc', 'ab' );
28+
testDiff( 1, 'abc', 'c' );
29+
testDiff( 2, 'abc', 'b' );
3030
} );
3131

3232
describe( 'replacement', () => {
33-
test( 2, 'abc', 'def' );
34-
test( 2, 'abc', 'axc' );
35-
test( 2, 'abc', 'axyc' );
36-
test( 2, 'abc', 'xybc' );
37-
test( 2, 'abc', 'abxy' );
33+
testDiff( 2, 'abc', 'def' );
34+
testDiff( 2, 'abc', 'axc' );
35+
testDiff( 2, 'abc', 'axyc' );
36+
testDiff( 2, 'abc', 'xybc' );
37+
testDiff( 2, 'abc', 'abxy' );
3838
} );
3939

4040
describe( 'various', () => {
41-
test( 3, 'abc', 'xbccy' );
42-
test( 2, 'abcdef', 'defabc' );
43-
test( 4, 'abcdef', 'axxdeyyfz' );
44-
test( 4, 'abcdef', 'xybzc' );
45-
test( 5, 'abcdef', 'bdxfy' );
41+
testDiff( 3, 'abc', 'xbccy' );
42+
testDiff( 2, 'abcdef', 'defabc' );
43+
testDiff( 4, 'abcdef', 'axxdeyyfz' );
44+
testDiff( 4, 'abcdef', 'xybzc' );
45+
testDiff( 5, 'abcdef', 'bdxfy' );
4646
} );
4747

4848
it( 'works with arrays', () => {
@@ -62,7 +62,7 @@ describe( 'diffToChanges', () => {
6262
expect( changes ).to.have.lengthOf( 3 );
6363
} );
6464

65-
function test( expectedChangeNumber, oldStr, newStr ) {
65+
function testDiff( expectedChangeNumber, oldStr, newStr ) {
6666
it( `${ oldStr } => ${ newStr }`, () => {
6767
const changes = diffToChanges( diff( oldStr, newStr ), newStr );
6868
const oldStrChars = Array.from( oldStr );

tests/dom/getcommonancestor.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,33 @@ describe( 'getParents', () => {
3030
div = createElement( document, 'div', {}, [ p1, p2 ] );
3131
} );
3232

33-
function test( a, b, lca ) {
33+
function testParents( a, b, lca ) {
3434
expect( getCommonAncestor( a, b ) ).to.equal( lca );
3535
expect( getCommonAncestor( b, a ) ).to.equal( lca );
3636
}
3737

3838
it( 'should return lowest common ancestor of nodes in different tree branches', () => {
39-
test( p1, p2, div );
40-
test( span1, span2, p1 );
41-
test( b, span2, p1 );
42-
test( i, b, div );
39+
testParents( p1, p2, div );
40+
testParents( span1, span2, p1 );
41+
testParents( b, span2, p1 );
42+
testParents( i, b, div );
4343
} );
4444

4545
it( 'should return one of nodes if it is a parent of another node', () => {
46-
test( div, p1, div );
47-
test( p1, b, p1 );
46+
testParents( div, p1, div );
47+
testParents( p1, b, p1 );
4848
} );
4949

5050
it( 'should return the node if both parameters are same', () => {
51-
test( div, div, div );
52-
test( b, b, b );
51+
testParents( div, div, div );
52+
testParents( b, b, b );
5353
} );
5454

5555
it( 'should return null for nodes that do not have common ancestor (different trees)', () => {
5656
const diffB = createElement( document, 'b' );
5757
const diffDiv = createElement( document, 'div', {}, diffB );
5858

59-
test( diffB, span1, null );
60-
test( diffDiv, p1, null );
59+
testParents( diffB, span1, null );
60+
testParents( diffDiv, p1, null );
6161
} );
6262
} );

tests/dom/position.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe( 'getOptimalPosition()', () => {
109109
innerWidth: 10000,
110110
innerHeight: 10000,
111111
scrollX: 100,
112-
scrollY: 100,
112+
scrollY: 100
113113
} );
114114

115115
assertPosition( { element, target, positions: [ attachLeft ] }, {
@@ -170,7 +170,7 @@ describe( 'getOptimalPosition()', () => {
170170
}, {
171171
position: 'absolute',
172172
borderLeftWidth: '20px',
173-
borderTopWidth: '40px',
173+
borderTopWidth: '40px'
174174
} );
175175

176176
element.parentElement = parent;

tests/manual/tickets/148/1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function updateSourcePosition() {
2929
target,
3030
positions: [
3131
positions.above,
32-
positions.below,
32+
positions.below
3333
],
3434
limiter
3535
} );

0 commit comments

Comments
 (0)