Skip to content

Commit

Permalink
Make prettier happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Apr 29, 2024
1 parent 03fcf86 commit 900c448
Showing 1 changed file with 52 additions and 41 deletions.
93 changes: 52 additions & 41 deletions src/test/behavior.c2.test.ts
Expand Up @@ -272,11 +272,10 @@ describe("Behavior Tests", () => {
["Variable class", "Stat docs", "Inst docs"],
);

equal(project.children?.map((c) => c.name), [
"BadClass",
"CallableClass",
"VariableClass",
]);
equal(
project.children?.map((c) => c.name),
["BadClass", "CallableClass", "VariableClass"],
);
});

it("Handles const type parameters", () => {
Expand All @@ -289,7 +288,10 @@ describe("Behavior Tests", () => {

it("Handles declare global 'modules'", () => {
const project = convert("declareGlobal");
equal(project.children?.map((c) => c.name), ["DeclareGlobal"]);
equal(
project.children?.map((c) => c.name),
["DeclareGlobal"],
);
});

it("Handles duplicate heritage clauses", () => {
Expand Down Expand Up @@ -438,7 +440,10 @@ describe("Behavior Tests", () => {
app.options.setValue("excludeCategories", ["A", "Default"]);
app.options.setValue("defaultCategory", "Default");
const project = convert("excludeCategories");
equal(project.children?.map((c) => c.name), ["c"]);
equal(
project.children?.map((c) => c.name),
["c"],
);
});

it("Handles excludeNotDocumentedKinds", () => {
Expand Down Expand Up @@ -515,12 +520,10 @@ describe("Behavior Tests", () => {
const C = query(project, "C");
const D = query(project, "D");

equal(project.groups?.map((g) => g.title), [
"Variables",
"A",
"B",
"With Spaces",
]);
equal(
project.groups?.map((g) => g.title),
["Variables", "A", "B", "With Spaces"],
);

equal(
project.groups?.map((g) =>
Expand All @@ -538,7 +541,10 @@ describe("Behavior Tests", () => {
it("Inherits @group tag if comment is not redefined", () => {
const project = convert("groupInheritance");
const cls = query(project, "Cls");
equal(cls.groups?.map((g) => g.title), ["Constructors", "Group"]);
equal(
cls.groups?.map((g) => g.title),
["Constructors", "Group"],
);
equal(
cls.groups.map((g) => g.children),
[[query(project, "Cls.constructor")], [query(project, "Cls.prop")]],
Expand All @@ -549,7 +555,10 @@ describe("Behavior Tests", () => {
app.options.setValue("categorizeByGroup", false);
const project = convert("categoryInheritance");
const cls = query(project, "Cls");
equal(cls.categories?.map((g) => g.title), ["Cat", "Other"]);
equal(
cls.categories?.map((g) => g.title),
["Cat", "Other"],
);
equal(
cls.categories?.map((g) =>
Comment.combineDisplayParts(g.description),
Expand All @@ -565,12 +574,10 @@ describe("Behavior Tests", () => {
it("Handles hidden accessors", () => {
const project = convert("hiddenAccessor");
const test = query(project, "Test");
equal(test.children?.map((c) => c.name), [
"constructor",
"auto",
"x",
"y",
]);
equal(
test.children?.map((c) => c.name),
["constructor", "auto", "x", "y"],
);
});

it("Handles simple @inheritDoc cases", () => {
Expand Down Expand Up @@ -941,10 +948,10 @@ describe("Behavior Tests", () => {
equal(fooComments, ["No arg comment\n", "No arg comment\n"]);
equal(foo.comment, undefined);

equal(foo.signatures?.map((s) => s.comment?.label), [
"NO_ARGS",
"WITH_X",
]);
equal(
foo.signatures?.map((s) => s.comment?.label),
["NO_ARGS", "WITH_X"],
);

const bar = query(project, "bar");
const barComments = bar.signatures?.map((sig) =>
Expand Down Expand Up @@ -1062,7 +1069,10 @@ describe("Behavior Tests", () => {
const project = convert("typeAliasInterface");
const bar = query(project, "Bar");
equal(bar.kind, ReflectionKind.Interface);
equal(bar.children?.map((c) => c.name), ["a", "b"]);
equal(
bar.children?.map((c) => c.name),
["a", "b"],
);

const comments = [bar, bar.children[0], bar.children[1]].map((r) =>
Comment.combineDisplayParts(r.comment?.summary),
Expand All @@ -1074,34 +1084,35 @@ describe("Behavior Tests", () => {
it("Allows specifying group sort order #2251", () => {
app.options.setValue("groupOrder", ["B", "Variables", "A"]);
const project = convert("groupTag");
equal(project.groups?.map((g) => g.title), [
"B",
"Variables",
"A",
"With Spaces",
]);
equal(
project.groups?.map((g) => g.title),
["B", "Variables", "A", "With Spaces"],
);
});

it("Supports disabling sorting of entry points #2393", () => {
app.options.setValue("sort", ["alphabetical"]);
const project = convert("blockComment", "asConstEnum");
equal(project.children?.map((c) => c.name), [
"asConstEnum",
"blockComment",
]);
equal(
project.children?.map((c) => c.name),
["asConstEnum", "blockComment"],
);

app.options.setValue("sortEntryPoints", false);
const project2 = convert("blockComment", "asConstEnum");
equal(project2.children?.map((c) => c.name), [
"blockComment",
"asConstEnum",
]);
equal(
project2.children?.map((c) => c.name),
["blockComment", "asConstEnum"],
);
});

it("Respects resolution-mode when resolving types", () => {
app.options.setValue("excludeExternals", false);
const MergedType = query(convert("resolutionMode"), "MergedType");
equal(MergedType.children?.map((child) => child.name), ["cjs", "esm"]);
equal(
MergedType.children?.map((child) => child.name),
["cjs", "esm"],
);
});

it("Special cases some `this` type occurrences", () => {
Expand Down

0 comments on commit 900c448

Please sign in to comment.