Skip to content

Commit bf21f20

Browse files
committed
Fix tests to use text when useText method is used
1 parent 8d05c4d commit bf21f20

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/server/scriptInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class TextStorage {
128128
}
129129

130130
/** Public for testing */
131-
public useText(newText?: string) {
131+
public useText(newText: string) {
132132
this.svc = undefined;
133133
this.text = newText;
134134
this.lineMap = undefined;

src/testRunner/unittests/tsserver/textStorage.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ describe("unittests:: tsserver:: Text storage", () => {
2525
const ts2 = new ts.server.TextStorage(host, getDummyScriptInfo(ts.server.asNormalizedPath(f.path)));
2626

2727
ts1.useScriptVersionCache_TestOnly();
28-
ts2.useText();
2928

3029
const lineMap = ts.computeLineStarts(f.content);
3130

@@ -64,7 +63,7 @@ describe("unittests:: tsserver:: Text storage", () => {
6463
ts1.edit(0, 5, " ");
6564
assert.isTrue(ts1.hasScriptVersionCache_TestOnly(), "have script version cache - 1");
6665

67-
ts1.useText();
66+
ts1.useText("");
6867
assert.isFalse(ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 2");
6968

7069
ts1.getAbsolutePositionAndLineText(0);

0 commit comments

Comments
 (0)