mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Fix more tests missing 'it' call in 'describe' (#48994)
This commit is contained in:
@@ -180,30 +180,34 @@ describe("unittests:: Public APIs:: validateLocaleAndSetLanguage", () => {
|
||||
});
|
||||
|
||||
describe("unittests:: Public APIs :: forEachChild of @param comments in JSDoc", () => {
|
||||
const content = `
|
||||
it("finds correct children", () => {
|
||||
const content = `
|
||||
/**
|
||||
* @param The {@link TypeReferencesInAedoc}.
|
||||
*/
|
||||
var x
|
||||
`;
|
||||
const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true);
|
||||
const paramTag = sourceFile.getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0];
|
||||
const kids = paramTag.getChildren();
|
||||
const seen: Set<ts.Node> = new Set();
|
||||
ts.forEachChild(paramTag, n => {
|
||||
assert.strictEqual(/*actual*/ false, seen.has(n), "Found a duplicate-added child");
|
||||
seen.add(n);
|
||||
const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true);
|
||||
const paramTag = sourceFile.getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0];
|
||||
const kids = paramTag.getChildren();
|
||||
const seen: Set<ts.Node> = new Set();
|
||||
ts.forEachChild(paramTag, n => {
|
||||
assert.strictEqual(/*actual*/ false, seen.has(n), "Found a duplicate-added child");
|
||||
seen.add(n);
|
||||
});
|
||||
assert.equal(5, kids.length);
|
||||
});
|
||||
assert.equal(5, kids.length);
|
||||
});
|
||||
|
||||
describe("unittests:: Public APIs:: getChild* methods on EndOfFileToken with JSDoc", () => {
|
||||
const content = `
|
||||
it("finds correct children", () => {
|
||||
const content = `
|
||||
/** jsdoc comment attached to EndOfFileToken */
|
||||
`;
|
||||
const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true);
|
||||
const endOfFileToken = sourceFile.getChildren()[1];
|
||||
assert.equal(endOfFileToken.getChildren().length, 1);
|
||||
assert.equal(endOfFileToken.getChildCount(), 1);
|
||||
assert.notEqual(endOfFileToken.getChildAt(0), /*expected*/ undefined);
|
||||
const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true);
|
||||
const endOfFileToken = sourceFile.getChildren()[1];
|
||||
assert.equal(endOfFileToken.getChildren().length, 1);
|
||||
assert.equal(endOfFileToken.getChildCount(), 1);
|
||||
assert.notEqual(endOfFileToken.getChildAt(0), /*expected*/ undefined);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user