Skip to content

Commit 92a421a

Browse files
committed
Add a test for not mutating spread variables
1 parent 165c809 commit 92a421a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/index.test.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,10 @@ describe('htm', () => {
168168
expect(html`<a>${''}9aaaaaaaaa${''}</a>`).not.toEqual(html`<a>${''}0${''}aaaaaaaaa${''}</a>`);
169169
expect(html`<a>${''}0${''}aaaaaaaa${''}</a>`).not.toEqual(html`<a>${''}.8aaaaaaaa${''}</a>`);
170170
});
171+
172+
test('do not mutate spread variables', () => {
173+
const obj = {};
174+
html`<a ...${obj} b="1" />`;
175+
expect(obj).toEqual({});
176+
});
171177
});

0 commit comments

Comments
 (0)