Skip to content

Commit 7f12f0c

Browse files
committed
Add breaking test
1 parent 3f3e3f4 commit 7f12f0c

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

fixtures/input/astro.astro

+17
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,21 @@ const content = "hi!";
1818
document.querySelector('h1')?.addEventListener('click', () => {
1919
logger('clicked');
2020
});
21+
22+
function someFunction() {
23+
const theme = (() => {
24+
if (
25+
typeof localStorage !== 'undefined' && localStorage.getItem('theme')
26+
) {
27+
return localStorage.getItem('theme')
28+
}
29+
})()
30+
if (theme === 'light') {
31+
document.documentElement.classList.remove('dark')
32+
} else {
33+
document.documentElement.classList.add('dark')
34+
}
35+
return
36+
}
37+
someFunction()
2138
</script>

fixtures/output/all/astro.astro

+18
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,22 @@ const { log: logger } = console
1818
document.querySelector('h1')?.addEventListener('click', () => {
1919
logger('clicked')
2020
})
21+
22+
function someFunction() {
23+
const theme = (() => {
24+
if (
25+
typeof localStorage !== 'undefined'
26+
&& localStorage.getItem('theme')
27+
) {
28+
return localStorage.getItem('theme')
29+
}
30+
})()
31+
if (theme === 'light') {
32+
document.documentElement.classList.remove('dark')
33+
}
34+
else {
35+
document.documentElement.classList.add('dark')
36+
}
37+
}
38+
someFunction()
2139
</script>

0 commit comments

Comments
 (0)