Skip to content

Commit 0028a87

Browse files
committed
add test coverage for rangeBy
1 parent 1372ac3 commit 0028a87

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

lib/__tests__/parse.test.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ describe('no interpolations', () => {
4040
line: 1,
4141
column: 38,
4242
});
43+
expect(decl.rangeBy({})).toEqual({
44+
start: {
45+
column: 28,
46+
line: 1,
47+
},
48+
end: {
49+
column: 39,
50+
line: 1,
51+
},
52+
});
53+
expect(decl.rangeBy({ word: 'red' })).toEqual({
54+
start: {
55+
column: 35,
56+
line: 1,
57+
},
58+
end: {
59+
column: 38,
60+
line: 1,
61+
},
62+
});
4363
});
4464

4565
test('two components', () => {
@@ -111,6 +131,26 @@ describe('no interpolations', () => {
111131
line: 2,
112132
column: 45,
113133
});
134+
expect(secondComponent.rangeBy({})).toEqual({
135+
start: {
136+
column: 28,
137+
line: 2,
138+
},
139+
end: {
140+
column: 47,
141+
line: 2,
142+
},
143+
});
144+
expect(secondComponent.rangeBy({ word: 'blue' })).toEqual({
145+
start: {
146+
column: 42,
147+
line: 2,
148+
},
149+
end: {
150+
column: 46,
151+
line: 2,
152+
},
153+
});
114154
});
115155

116156
test('empty component', () => {

0 commit comments

Comments
 (0)