Skip to content

Commit b5b4f3b

Browse files
committed
Add failing test
1 parent 3da4525 commit b5b4f3b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: src/parse-result.test.ts

+13
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,19 @@ describe('ember-template-recast', function () {
17381738
expect(print(ast)).toEqual('Bar');
17391739
});
17401740

1741+
test('updating also adjust loc', function () {
1742+
let template = `short`;
1743+
1744+
let ast = parse(template) as any;
1745+
1746+
const body = ast.body[0];
1747+
body.chars = 'much longer';
1748+
1749+
expect(body.loc.end.column).toEqual(11);
1750+
1751+
expect(print(ast)).toEqual('much longer');
1752+
});
1753+
17411754
test('can be updated as value of AttrNode', function () {
17421755
let template = `<div class="lol"></div>`;
17431756

0 commit comments

Comments
 (0)