Update dependencies (#58458)

This commit is contained in:
Jake Bailey
2024-05-07 12:55:16 -07:00
committed by GitHub
parent 14b4529a69
commit 9d714f47c0
11 changed files with 443 additions and 548 deletions

View File

@@ -14,19 +14,19 @@ describe("comment parsing", () => {
it("skips shebang", () => {
const result = ts.getLeadingCommentRanges(withShebang, 0);
assert.isDefined(result);
assert.strictEqual(result!.length, 2);
assert.strictEqual(result.length, 2);
});
it("treats all comments at start of file as leading comments", () => {
const result = ts.getLeadingCommentRanges(noShebang, 0);
assert.isDefined(result);
assert.strictEqual(result!.length, 2);
assert.strictEqual(result.length, 2);
});
it("returns leading comments if position is not 0", () => {
const result = ts.getLeadingCommentRanges(withTrailing, 1);
assert.isDefined(result);
assert.strictEqual(result!.length, 1);
assert.strictEqual(result![0].kind, ts.SyntaxKind.SingleLineCommentTrivia);
assert.strictEqual(result.length, 1);
assert.strictEqual(result[0].kind, ts.SyntaxKind.SingleLineCommentTrivia);
});
});

View File

@@ -20,8 +20,8 @@ describe("unittests:: evaluation:: autoAccessors", () => {
const desc = Object.getOwnPropertyDescriptor(C.prototype, "x");
assert.isDefined(desc);
assert.isFunction(desc!.get);
assert.isFunction(desc!.set);
assert.isFunction(desc.get);
assert.isFunction(desc.set);
});
it("storage is private", async () => {

View File

@@ -232,8 +232,8 @@ describe("unittests:: evaluation:: awaitUsingDeclarations", () => {
]);
assert.instanceOf(output[4], Error);
assert.strictEqual(output[4].name, "SuppressedError");
assert.strictEqual(output[4].error, "dispose error");
assert.strictEqual(output[4].suppressed, "body error");
assert.strictEqual((output[4] as any).error, "dispose error");
assert.strictEqual((output[4] as any).suppressed, "body error");
assert.deepEqual(output.slice(5), [
"after try",
]);

View File

@@ -351,8 +351,8 @@ describe("unittests:: evaluation:: usingDeclarations", () => {
]);
assert.instanceOf(output[4], Error);
assert.strictEqual(output[4].name, "SuppressedError");
assert.strictEqual(output[4].error, "dispose error");
assert.strictEqual(output[4].suppressed, "body error");
assert.strictEqual((output[4] as any).error, "dispose error");
assert.strictEqual((output[4] as any).suppressed, "body error");
assert.deepEqual(output.slice(5), [
"after try",
]);

View File

@@ -519,7 +519,7 @@ oh.no
assert.equal(root.kind, ts.SyntaxKind.SourceFile);
const first = root.getFirstToken();
assert.isDefined(first);
assert.equal(first!.kind, ts.SyntaxKind.VarKeyword);
assert.equal(first.kind, ts.SyntaxKind.VarKeyword);
});
});
describe("getLastToken", () => {
@@ -528,7 +528,7 @@ oh.no
assert.isDefined(root);
const last = root.getLastToken();
assert.isDefined(last);
assert.equal(last!.kind, ts.SyntaxKind.EndOfFileToken);
assert.equal(last.kind, ts.SyntaxKind.EndOfFileToken);
});
});
describe("getStart", () => {

View File

@@ -67,7 +67,7 @@ function test() {}`;
const funcDec = testSourceFile.statements.find(ts.isFunctionDeclaration)!;
const tags = ts.getJSDocTags(funcDec);
assert.isDefined(tags[0].comment);
assert.isDefined(tags[0].comment![0]);
assert.isDefined(tags[0].comment[0]);
assert.isString(tags[0].comment);
assert.equal(tags[0].comment as string, "Some\n text\r\n with newlines.");
});

View File

@@ -117,8 +117,8 @@ describe("unittests:: tsserver:: exportMapCache::", () => {
if (symbolName === "SIGINT") sigintPropBefore = info;
});
assert.ok(sigintPropBefore);
assert.ok(sigintPropBefore![0].symbol.flags & ts.SymbolFlags.Transient);
const symbolIdBefore = ts.getSymbolId(sigintPropBefore![0].symbol);
assert.ok(sigintPropBefore[0].symbol.flags & ts.SymbolFlags.Transient);
const symbolIdBefore = ts.getSymbolId(sigintPropBefore[0].symbol);
// Update program without clearing cache
session.executeCommandSeq<ts.server.protocol.UpdateOpenRequest>({
@@ -143,7 +143,7 @@ describe("unittests:: tsserver:: exportMapCache::", () => {
if (symbolName === "SIGINT") sigintPropAfter = info;
});
assert.ok(sigintPropAfter);
assert.notEqual(symbolIdBefore, ts.getSymbolId(sigintPropAfter![0].symbol));
assert.notEqual(symbolIdBefore, ts.getSymbolId(sigintPropAfter[0].symbol));
baselineTsserverLogs("exportMapCache", "does not store transient symbols through program updates", session);
});

View File

@@ -118,8 +118,8 @@ import { something } from "something";
};
const response = session.executeCommandSeq(request).response as ts.server.protocol.SyntacticDiagnosticsSyncResponse["body"];
assert.isDefined(response);
assert.equal(response!.length, 1);
assert.equal((response![0] as ts.server.protocol.Diagnostic).text, expectedErrorMessage);
assert.equal(response.length, 1);
assert.equal((response[0] as ts.server.protocol.Diagnostic).text, expectedErrorMessage);
const project = service.inferredProjects[0];
const diagnostics = project.getLanguageService().getSyntacticDiagnostics(file1.path);