Skip to content

Commit c4643d1

Browse files
committed
feat(tests): Add snapshot test for renaming
This commit introduces a new snapshot test for the svelte rename feature. A new test file 'Rename.svelte' has been added to the 'test_project' directory. The test asserts the snapshot of the processed code against the expected output.
1 parent 8a17b1d commit c4643d1

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

__snapshots__/mod_test.ts.snap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,17 @@ p {
5656
</style>
5757
\`
5858
`;
59+
60+
snapshot[`example svelte rename 1`] = `
61+
'<div class="m3">This is a paragraph</div>
62+
63+
<style>
64+
65+
.m3 {
66+
background: yellow;
67+
}
68+
69+
70+
</style>
71+
'
72+
`;

mod_test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,11 @@ Deno.test(
3434
await assertSnapshot(t, code);
3535
},
3636
);
37+
38+
Deno.test(
39+
"example svelte rename",
40+
async function (t) {
41+
const code = await load("./test_project/Rename.svelte");
42+
await assertSnapshot(t, code);
43+
},
44+
);

test_project/Rename.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="m3">This is a paragraph</div>
2+
3+
<style>
4+
@import './partial.css?.m2=.m3' scoped;
5+
</style>

0 commit comments

Comments
 (0)