Skip to content

Commit 93907fd

Browse files
committed
测试中 axios 改为 moment
1 parent c8a0d60 commit 93907fd

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/pkg/utils/monaco-editor/utils.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("findGlobalInsertionInfo", () => {
4141
});
4242

4343
it("应该处理包含global关键字的多行块注释", () => {
44-
const model = createMockModel(["/* global jQuery,", " axios */", "const x = 1;"]);
44+
const model = createMockModel(["/* global jQuery,", " moment */", "const x = 1;"]);
4545
const result = findGlobalInsertionInfo(model);
4646
expect(result).toEqual({ insertLine: 3, globalLine: 1 });
4747
});
@@ -105,8 +105,8 @@ describe("updateGlobalCommentLine", () => {
105105

106106
it("应该在注释末尾添加新的全局变量", () => {
107107
const line = "/* global jQuery */";
108-
const result = updateGlobalCommentLine(line, "axios");
109-
expect(result).toBe("/* global jQuery, axios */");
108+
const result = updateGlobalCommentLine(line, "moment");
109+
expect(result).toBe("/* global jQuery, moment */");
110110
});
111111

112112
it("应该在只有global关键字的注释后添加变量", () => {
@@ -117,8 +117,8 @@ describe("updateGlobalCommentLine", () => {
117117

118118
it("应该处理以逗号结尾的注释", () => {
119119
const line = "/* global jQuery, */";
120-
const result = updateGlobalCommentLine(line, "axios");
121-
expect(result).toBe("/* global jQuery, axios */");
120+
const result = updateGlobalCommentLine(line, "moment");
121+
expect(result).toBe("/* global jQuery, moment */");
122122
});
123123

124124
it("应该处理多个已存在的全局变量", () => {
@@ -129,18 +129,18 @@ describe("updateGlobalCommentLine", () => {
129129

130130
it("应该处理注释后有额外内容的情况", () => {
131131
const line = "/* global jQuery */ // some comment";
132-
const result = updateGlobalCommentLine(line, "axios");
133-
expect(result).toBe("/* global jQuery, axios */ // some comment");
132+
const result = updateGlobalCommentLine(line, "moment");
133+
expect(result).toBe("/* global jQuery, moment */ // some comment");
134134
});
135135

136136
it("应该处理格式不正确的注释(缺少*/)", () => {
137137
const line = "/* global jQuery";
138-
const result = updateGlobalCommentLine(line, "axios");
139-
expect(result).toBe("/* global jQuery, axios");
138+
const result = updateGlobalCommentLine(line, "moment");
139+
expect(result).toBe("/* global jQuery, moment");
140140
});
141141

142142
it("应该避免重复添加相同的全局变量", () => {
143-
const line = "/* global jQuery, axios */";
143+
const line = "/* global jQuery, moment */";
144144
const result = updateGlobalCommentLine(line, "jQuery");
145145
expect(result).toBe(line);
146146
});

0 commit comments

Comments
 (0)