From b5b4f3bf0ae929b6bd5b0deb744f099ae9a57010 Mon Sep 17 00:00:00 2001 From: Peter Wagenet Date: Thu, 14 Nov 2024 10:45:50 -0800 Subject: [PATCH] Add failing test --- src/parse-result.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/parse-result.test.ts b/src/parse-result.test.ts index 688bca81..f6731aba 100644 --- a/src/parse-result.test.ts +++ b/src/parse-result.test.ts @@ -1738,6 +1738,19 @@ describe('ember-template-recast', function () { expect(print(ast)).toEqual('Bar'); }); + test('updating also adjust loc', function () { + let template = `short`; + + let ast = parse(template) as any; + + const body = ast.body[0]; + body.chars = 'much longer'; + + expect(body.loc.end.column).toEqual(11); + + expect(print(ast)).toEqual('much longer'); + }); + test('can be updated as value of AttrNode', function () { let template = `
`;