Add describe prefix for better test navigation in IDE (#518)
Also fix a mistaken test grouping due to incorrect merge conflict resolution
This commit is contained in:
Родитель
932c8bdc31
Коммит
d4924d88a6
|
@ -2,7 +2,7 @@ import { ok, strictEqual } from "assert";
|
|||
import { ModelType, UnionType } from "../../compiler/types.js";
|
||||
import { createTestHost, TestHost } from "../test-host.js";
|
||||
|
||||
describe("aliases", () => {
|
||||
describe("adl: aliases", () => {
|
||||
let testHost: TestHost;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { rejects } from "assert";
|
||||
import { createTestHost, TestHost } from "../test-host.js";
|
||||
|
||||
describe("duplicate declarations", () => {
|
||||
describe("adl: duplicate declarations", () => {
|
||||
let testHost: TestHost;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -2,7 +2,7 @@ import { ok, strictEqual } from "assert";
|
|||
import { EnumMemberType, EnumType, ModelType } from "../../compiler/types.js";
|
||||
import { createTestHost, TestHost } from "../test-host.js";
|
||||
|
||||
describe("enums", () => {
|
||||
describe("adl: enums", () => {
|
||||
let testHost: TestHost;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { createTestHost, TestHost } from "../test-host.js";
|
||||
|
||||
describe("loader", () => {
|
||||
describe("adl: loader", () => {
|
||||
let testHost: TestHost;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -2,7 +2,7 @@ import { ok, strictEqual } from "assert";
|
|||
import { ModelType, NamespaceType, Type } from "../../compiler/types.js";
|
||||
import { createTestHost, TestHost } from "../test-host.js";
|
||||
|
||||
describe("namespaces with blocks", () => {
|
||||
describe("adl: namespaces with blocks", () => {
|
||||
const blues = new WeakSet();
|
||||
function blue(_: any, target: Type) {
|
||||
blues.add(target);
|
||||
|
@ -152,7 +152,7 @@ describe("namespaces with blocks", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("blockless namespaces", () => {
|
||||
describe("adl: blockless namespaces", () => {
|
||||
const blues = new WeakSet();
|
||||
function blue(_: any, target: Type) {
|
||||
blues.add(target);
|
||||
|
|
|
@ -2,7 +2,7 @@ import { ok, strictEqual } from "assert";
|
|||
import { ModelType, Type } from "../../compiler/types.js";
|
||||
import { createTestHost, TestHost } from "../test-host.js";
|
||||
|
||||
describe("spread", () => {
|
||||
describe("adl: spread", () => {
|
||||
const blues = new WeakSet();
|
||||
function blue(_: any, target: Type) {
|
||||
blues.add(target);
|
||||
|
|
|
@ -2,7 +2,7 @@ import { rejects, strictEqual } from "assert";
|
|||
import { ModelType } from "../../compiler/types";
|
||||
import { createTestHost, TestHost } from "../test-host.js";
|
||||
|
||||
describe("using statements", () => {
|
||||
describe("adl: using statements", () => {
|
||||
let testHost: TestHost;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ModelType } from "../../compiler/types.js";
|
|||
import { getMaxValue, getMinValue } from "../../lib/decorators.js";
|
||||
import { createTestHost, TestHost } from "../test-host.js";
|
||||
|
||||
describe("range limiting decorators", () => {
|
||||
describe("adl: range limiting decorators", () => {
|
||||
let testHost: TestHost;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { NodeHost } from "../../compiler/util.js";
|
|||
|
||||
const libs = ["simple"];
|
||||
|
||||
describe("libraries", () => {
|
||||
describe("adl: libraries", () => {
|
||||
for (const lib of libs) {
|
||||
describe(lib, () => {
|
||||
it("compiles without error", async () => {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { logDiagnostics, logVerboseTestOutput } from "../compiler/diagnostics.js
|
|||
import { hasParseError, NodeFlags, parse } from "../compiler/parser.js";
|
||||
import { ADLScriptNode, SyntaxKind } from "../compiler/types.js";
|
||||
|
||||
describe("syntax", () => {
|
||||
describe("adl: syntax", () => {
|
||||
describe("import statements", () => {
|
||||
parseEach(['import "x";']);
|
||||
|
||||
|
@ -373,20 +373,20 @@ describe("syntax", () => {
|
|||
|
||||
parseErrorEach(bad.map((e) => [`model ${e[0]} {}`, [e[1]]]));
|
||||
});
|
||||
});
|
||||
|
||||
// smaller repro of previous regen-samples baseline failures
|
||||
describe("sample regressions", () => {
|
||||
parseEach([
|
||||
[
|
||||
`/* \\n <-- before string! */ @format("\\\\w") model M {}`,
|
||||
(node) => {
|
||||
assert(node.statements[0].kind === SyntaxKind.ModelStatement);
|
||||
assert(node.statements[0].decorators[0].arguments[0].kind === SyntaxKind.StringLiteral);
|
||||
assert.strictEqual(node.statements[0].decorators[0].arguments[0].value, "\\w");
|
||||
},
|
||||
],
|
||||
]);
|
||||
// smaller repro of previous regen-samples baseline failures
|
||||
describe("sample regressions", () => {
|
||||
parseEach([
|
||||
[
|
||||
`/* \\n <-- before string! */ @format("\\\\w") model M {}`,
|
||||
(node) => {
|
||||
assert(node.statements[0].kind === SyntaxKind.ModelStatement);
|
||||
assert(node.statements[0].decorators[0].arguments[0].kind === SyntaxKind.StringLiteral);
|
||||
assert.strictEqual(node.statements[0].decorators[0].arguments[0].value, "\\w");
|
||||
},
|
||||
],
|
||||
]);
|
||||
});
|
||||
|
||||
describe("enum statements", () => {
|
||||
parseEach([
|
||||
|
|
|
@ -92,7 +92,7 @@ function verify(tokens: TokenEntry[], expecting: TokenEntry[]) {
|
|||
}
|
||||
}
|
||||
|
||||
describe("scanner", () => {
|
||||
describe("adl: scanner", () => {
|
||||
/** verifies that we can scan tokens and get back some output. */
|
||||
it("smoketest", () => {
|
||||
const all = tokens('\tthis is "a" test');
|
||||
|
|
Загрузка…
Ссылка в новой задаче