Skip to content

Commit 222146b

Browse files
committed
update test
1 parent 6e58cd2 commit 222146b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/core/__tests__/preserve_comments.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ describe("Should preserve comments", () => {
88
it("Should preserve comments preceding types", async () => {
99
const input = `/*comment*/ type X = number; const x: X = 1`;
1010
const result = swc.transformSync(input, {
11-
"jsc": {
12-
"parser": {
13-
"syntax": "typescript",
11+
jsc: {
12+
parser: {
13+
syntax: "typescript",
1414
},
15-
"preserveAllComments": true
16-
}
15+
preserveAllComments: true,
16+
},
1717
});
18-
expect(result.code).toBe('/*comment*/ var x = 1;\n');
18+
expect(result.code).toBe("/*comment*/ var x = 1;\n");
1919
});
2020

2121
it("Should preserve comments preceding shifted functions", () => {
@@ -25,8 +25,8 @@ describe("Should preserve comments", () => {
2525

2626
const { code } = swc.transformFileSync(filename);
2727

28-
expect(code).toContain("/* input 1 comment 1 */ \"use strict\"")
29-
expect(code).toContain(`// input 1 comment 2\nvar saysHello =`)
28+
expect(code).toContain("/* input 1 comment 1 */ var tail");
29+
expect(code).toContain(`// input 1 comment 2\nvar saysHello =`);
3030
});
3131

3232
it("Should not share comments between modules", () => {
@@ -46,6 +46,6 @@ describe("Should preserve comments", () => {
4646
expect(result1.code).not.toMatch("input 2");
4747

4848
expect(result2.code).toMatch("input 2");
49-
expect(result2.code).not.toMatch("input 1")
49+
expect(result2.code).not.toMatch("input 1");
5050
});
51-
})
51+
});

0 commit comments

Comments
 (0)