From 84269f71120f7cbdddf8d134e7ff5a5a4518641a Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Wed, 8 Mar 2023 09:12:02 +0100 Subject: [PATCH] Revert describe block prefixes --- packages/connect/src/protocol-connect/content-type.spec.ts | 2 +- packages/connect/src/protocol-connect/end-stream.spec.ts | 4 ++-- packages/connect/src/protocol-connect/error-json.spec.ts | 4 ++-- .../connect/src/protocol-connect/handler-factory.spec.ts | 2 +- packages/connect/src/protocol-connect/parse-timeout.spec.ts | 2 +- .../connect/src/protocol-connect/request-header.spec.ts | 4 ++-- packages/connect/src/protocol-connect/trailer-mux.spec.ts | 2 +- packages/connect/src/protocol-grpc-web/content-type.spec.ts | 2 +- .../connect/src/protocol-grpc-web/request-header.spec.ts | 2 +- packages/connect/src/protocol-grpc-web/trailer.spec.ts | 6 +++--- packages/connect/src/protocol-grpc/content-type.spec.ts | 2 +- packages/connect/src/protocol-grpc/parse-timeout.spec.ts | 2 +- packages/connect/src/protocol-grpc/request-header.spec.ts | 2 +- packages/connect/src/protocol-grpc/trailer-status.spec.ts | 4 ++-- packages/connect/src/protocol/content-type-matcher.spec.ts | 2 +- packages/connect/src/protocol/create-method-url.spec.ts | 2 +- packages/connect/src/protocol/serialization.spec.ts | 6 +++--- packages/connect/src/protocol/universal-handler.spec.ts | 4 ++-- 18 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/connect/src/protocol-connect/content-type.spec.ts b/packages/connect/src/protocol-connect/content-type.spec.ts index 7b68c39b3..90cb1ccba 100644 --- a/packages/connect/src/protocol-connect/content-type.spec.ts +++ b/packages/connect/src/protocol-connect/content-type.spec.ts @@ -20,7 +20,7 @@ import { parseContentType, } from "./content-type.js"; -describe("protocol-connect/parseContentType()", function () { +describe("parseContentType()", function () { it("should parse", function () { expect(parseContentType(contentTypeUnaryJson)).toEqual({ stream: false, diff --git a/packages/connect/src/protocol-connect/end-stream.spec.ts b/packages/connect/src/protocol-connect/end-stream.spec.ts index 94fa00b26..2d492ad8d 100644 --- a/packages/connect/src/protocol-connect/end-stream.spec.ts +++ b/packages/connect/src/protocol-connect/end-stream.spec.ts @@ -21,7 +21,7 @@ import { errorToJson } from "./error-json.js"; node16FetchHeadersPolyfill(); -describe("protocol-connect/endStreamFromJson()", function () { +describe("endStreamFromJson()", function () { it("should parse expected", function () { const json: JsonObject = { error: { @@ -55,7 +55,7 @@ describe("protocol-connect/endStreamFromJson()", function () { }); }); -describe("protocol-connect/endStreamToJson()", function () { +describe("endStreamToJson()", function () { it("should be {} in the most simple form", function () { const got = endStreamToJson(new Headers(), undefined, undefined); const want: JsonObject = {}; diff --git a/packages/connect/src/protocol-connect/error-json.spec.ts b/packages/connect/src/protocol-connect/error-json.spec.ts index 4cd46e3c7..e5f05b597 100644 --- a/packages/connect/src/protocol-connect/error-json.spec.ts +++ b/packages/connect/src/protocol-connect/error-json.spec.ts @@ -22,7 +22,7 @@ import { Message, proto3, protoBase64, ScalarType } from "@bufbuild/protobuf"; import { errorFromJson, errorToJson } from "./error-json.js"; import { codeToString } from "./code-string.js"; -describe("protocol-connect/errorToJson()", () => { +describe("errorToJson()", () => { it("serializes code and message", () => { const json = errorToJson( new ConnectError("Not permitted", Code.PermissionDenied), @@ -79,7 +79,7 @@ describe("protocol-connect/errorToJson()", () => { }); }); -describe("protocol-connect/errorFromJson()", () => { +describe("errorFromJson()", () => { it("parses code and message", () => { const error = errorFromJson( { diff --git a/packages/connect/src/protocol-connect/handler-factory.spec.ts b/packages/connect/src/protocol-connect/handler-factory.spec.ts index b1cc806ee..13684bfd5 100644 --- a/packages/connect/src/protocol-connect/handler-factory.spec.ts +++ b/packages/connect/src/protocol-connect/handler-factory.spec.ts @@ -36,7 +36,7 @@ import { readAllBytes, } from "../protocol/async-iterable-helper.spec.js"; -describe("protocol-connect/createHandlerFactory()", function () { +describe("createHandlerFactory()", function () { const testService: ServiceType = { typeName: "TestService", methods: { diff --git a/packages/connect/src/protocol-connect/parse-timeout.spec.ts b/packages/connect/src/protocol-connect/parse-timeout.spec.ts index 1ad1c4b39..3e96c3486 100644 --- a/packages/connect/src/protocol-connect/parse-timeout.spec.ts +++ b/packages/connect/src/protocol-connect/parse-timeout.spec.ts @@ -15,7 +15,7 @@ import { ConnectError } from "../connect-error.js"; import { parseTimeout } from "./parse-timeout.js"; -describe("protocol-connect/parseTimeout()", function () { +describe("parseTimeout()", function () { it("should parse proper timeout", () => { expect(parseTimeout("1")).toEqual(1); expect(parseTimeout("1234567890")).toEqual(1234567890); diff --git a/packages/connect/src/protocol-connect/request-header.spec.ts b/packages/connect/src/protocol-connect/request-header.spec.ts index 7723b3f63..35dbbd965 100644 --- a/packages/connect/src/protocol-connect/request-header.spec.ts +++ b/packages/connect/src/protocol-connect/request-header.spec.ts @@ -31,7 +31,7 @@ function listHeaderKeys(header: Headers): string[] { return keys; } -describe("protocol-connect/requestHeader", () => { +describe("requestHeader", () => { it("should create request headers", () => { const headers = requestHeader(MethodKind.Unary, true, undefined, undefined); expect(listHeaderKeys(headers)).toEqual([ @@ -53,7 +53,7 @@ describe("protocol-connect/requestHeader", () => { }); }); -describe("protocol-connect/requestHeaderWithCompression", () => { +describe("requestHeaderWithCompression", () => { const compressionMock: Compression = { name: "gzip", compress: (bytes: Uint8Array) => Promise.resolve(bytes), diff --git a/packages/connect/src/protocol-connect/trailer-mux.spec.ts b/packages/connect/src/protocol-connect/trailer-mux.spec.ts index b78187197..bb886ee19 100644 --- a/packages/connect/src/protocol-connect/trailer-mux.spec.ts +++ b/packages/connect/src/protocol-connect/trailer-mux.spec.ts @@ -20,7 +20,7 @@ function listHeaderKeys(header: Headers): string[] { return keys; } -describe("protocol-connect/trailer-mux", function () { +describe("trailer-mux", function () { let headers: Headers, trailers: Headers, combined: Headers; beforeEach(() => { headers = new Headers({ diff --git a/packages/connect/src/protocol-grpc-web/content-type.spec.ts b/packages/connect/src/protocol-grpc-web/content-type.spec.ts index 705a3f456..838a451aa 100644 --- a/packages/connect/src/protocol-grpc-web/content-type.spec.ts +++ b/packages/connect/src/protocol-grpc-web/content-type.spec.ts @@ -18,7 +18,7 @@ import { contentTypeProto, } from "./content-type.js"; -describe("protocol-grpc-web/parseContentType()", function () { +describe("parseContentType()", function () { it("should parse", function () { expect(parseContentType(contentTypeProto)).toEqual({ text: false, diff --git a/packages/connect/src/protocol-grpc-web/request-header.spec.ts b/packages/connect/src/protocol-grpc-web/request-header.spec.ts index 12aa2f80a..6b4dc9682 100644 --- a/packages/connect/src/protocol-grpc-web/request-header.spec.ts +++ b/packages/connect/src/protocol-grpc-web/request-header.spec.ts @@ -28,7 +28,7 @@ function listHeaderKeys(header: Headers): string[] { return keys; } -describe("protocol-grpc-web/requestHeader", () => { +describe("requestHeader", () => { it("should create request headers", () => { const headers = requestHeader(true, undefined, undefined); expect(listHeaderKeys(headers)).toEqual([ diff --git a/packages/connect/src/protocol-grpc-web/trailer.spec.ts b/packages/connect/src/protocol-grpc-web/trailer.spec.ts index c8be0c3d7..4f7c423ef 100644 --- a/packages/connect/src/protocol-grpc-web/trailer.spec.ts +++ b/packages/connect/src/protocol-grpc-web/trailer.spec.ts @@ -14,7 +14,7 @@ import { trailerParse, trailerSerialize } from "./trailer.js"; -describe("protocol-grpc/trailerParse()", () => { +describe("trailerParse()", () => { it("parses very simple case", () => { const h = trailerParse(new TextEncoder().encode("foo: bar\r\n")); expect(h.get("foo")).toBe("bar"); @@ -37,7 +37,7 @@ describe("protocol-grpc/trailerParse()", () => { }); }); -describe("protocol-grpc-web/trailerSerialize()", () => { +describe("trailerSerialize()", () => { it("serializes empty", () => { const trailer = new Headers(); const data = trailerSerialize(trailer); @@ -60,7 +60,7 @@ describe("protocol-grpc-web/trailerSerialize()", () => { }); }); -describe("protocol-grpc-web/trailer roundtrip", () => { +describe("trailer roundtrip", () => { it("should work", () => { const a = new Headers({ foo: "a, b", diff --git a/packages/connect/src/protocol-grpc/content-type.spec.ts b/packages/connect/src/protocol-grpc/content-type.spec.ts index ad00499de..157b51432 100644 --- a/packages/connect/src/protocol-grpc/content-type.spec.ts +++ b/packages/connect/src/protocol-grpc/content-type.spec.ts @@ -18,7 +18,7 @@ import { contentTypeJson, } from "./content-type.js"; -describe("protocol-grpc/parseContentType()", function () { +describe("parseContentType()", function () { it("should parse", function () { expect(parseContentType(contentTypeProto)).toEqual({ binary: true, diff --git a/packages/connect/src/protocol-grpc/parse-timeout.spec.ts b/packages/connect/src/protocol-grpc/parse-timeout.spec.ts index b69e55d4f..067ddd743 100644 --- a/packages/connect/src/protocol-grpc/parse-timeout.spec.ts +++ b/packages/connect/src/protocol-grpc/parse-timeout.spec.ts @@ -15,7 +15,7 @@ import { ConnectError } from "../connect-error.js"; import { parseTimeout } from "./parse-timeout.js"; -describe("protocol-grpc/parseTimeout()", function () { +describe("parseTimeout()", function () { it("should parse proper timeout", () => { expect(parseTimeout("1H")).toEqual(3600000); expect(parseTimeout("1M")).toEqual(60000); diff --git a/packages/connect/src/protocol-grpc/request-header.spec.ts b/packages/connect/src/protocol-grpc/request-header.spec.ts index 280cee461..876ed9ef7 100644 --- a/packages/connect/src/protocol-grpc/request-header.spec.ts +++ b/packages/connect/src/protocol-grpc/request-header.spec.ts @@ -25,7 +25,7 @@ function listHeaderKeys(header: Headers): string[] { return keys; } -describe("protocol-grpc/requestHeader", () => { +describe("requestHeader", () => { it("should create request headers", () => { const headers = requestHeader(true, undefined, undefined); expect(listHeaderKeys(headers)).toEqual([ diff --git a/packages/connect/src/protocol-grpc/trailer-status.spec.ts b/packages/connect/src/protocol-grpc/trailer-status.spec.ts index b11c2f721..7fc09c911 100644 --- a/packages/connect/src/protocol-grpc/trailer-status.spec.ts +++ b/packages/connect/src/protocol-grpc/trailer-status.spec.ts @@ -17,7 +17,7 @@ import { ConnectError } from "../connect-error.js"; import { Code } from "../code.js"; import { Int32Value } from "@bufbuild/protobuf"; -describe("protocol-grpc/setTrailerStatus()", function () { +describe("setTrailerStatus()", function () { it("should set grpc-status when called without error", function () { const t = new Headers(); setTrailerStatus(t, undefined); @@ -65,7 +65,7 @@ describe("protocol-grpc/setTrailerStatus()", function () { }); }); -describe("protocol-grpc/findTrailerError()", function () { +describe("findTrailerError()", function () { it("should not find an error on empty trailer", function () { const t = new Headers(); expect(findTrailerError(t)).toBeUndefined(); diff --git a/packages/connect/src/protocol/content-type-matcher.spec.ts b/packages/connect/src/protocol/content-type-matcher.spec.ts index 52431d30a..a7b11415c 100644 --- a/packages/connect/src/protocol/content-type-matcher.spec.ts +++ b/packages/connect/src/protocol/content-type-matcher.spec.ts @@ -14,7 +14,7 @@ import { contentTypeMatcher } from "./content-type-matcher.js"; -describe("protocol/contentTypeMatcher()", function () { +describe("contentTypeMatcher()", function () { it("matches multiple regular expressions as expected", function () { const matcher = contentTypeMatcher(/a/, /b/); expect(matcher("a")).toBeTrue(); diff --git a/packages/connect/src/protocol/create-method-url.spec.ts b/packages/connect/src/protocol/create-method-url.spec.ts index 6cf875df6..6d57eeadc 100644 --- a/packages/connect/src/protocol/create-method-url.spec.ts +++ b/packages/connect/src/protocol/create-method-url.spec.ts @@ -14,7 +14,7 @@ import { createMethodUrl } from "./create-method-url.js"; -describe("protocol/createMethodUrl()", function () { +describe("createMethodUrl()", function () { it("should create the expected URL", function () { const url = createMethodUrl( "https://example.com", diff --git a/packages/connect/src/protocol/serialization.spec.ts b/packages/connect/src/protocol/serialization.spec.ts index a232531c6..f388375eb 100644 --- a/packages/connect/src/protocol/serialization.spec.ts +++ b/packages/connect/src/protocol/serialization.spec.ts @@ -21,7 +21,7 @@ import { } from "./serialization.js"; import { ConnectError, connectErrorFromReason } from "../connect-error.js"; -describe("protocol/createBinarySerialization()", function () { +describe("createBinarySerialization()", function () { const goldenMessage = new StringValue({ value: "abc" }); const goldenBytes = new StringValue({ value: "abc" }).toBinary(); const ser = createBinarySerialization(StringValue, undefined); @@ -69,7 +69,7 @@ describe("protocol/createBinarySerialization()", function () { }); }); -describe("protocol/createJsonSerialization()", function () { +describe("createJsonSerialization()", function () { const goldenMessage = new StringValue({ value: "abc" }); const goldenBytes = new TextEncoder().encode(`"abc"`); const ser = createJsonSerialization(StringValue, undefined); @@ -117,7 +117,7 @@ describe("protocol/createJsonSerialization()", function () { }); }); -describe("protocol/limitSerialization()", function () { +describe("limitSerialization()", function () { const ser: Serialization = { serialize(data: string): Uint8Array { return new TextEncoder().encode(data); diff --git a/packages/connect/src/protocol/universal-handler.spec.ts b/packages/connect/src/protocol/universal-handler.spec.ts index 25beeb74e..55f32ac0e 100644 --- a/packages/connect/src/protocol/universal-handler.spec.ts +++ b/packages/connect/src/protocol/universal-handler.spec.ts @@ -24,7 +24,7 @@ import type { Compression } from "./compression.js"; import { contentTypeMatcher } from "./content-type-matcher.js"; import { Headers } from "undici"; -describe("protocol/validateUniversalHandlerOptions()", function () { +describe("validateUniversalHandlerOptions()", function () { it("should set defaults", function () { const o = validateUniversalHandlerOptions({}); expect(o).toEqual({ @@ -67,7 +67,7 @@ describe("protocol/validateUniversalHandlerOptions()", function () { }); }); -describe("protocol/negotiateProtocol()", function () { +describe("negotiateProtocol()", function () { const testService: ServiceType = { typeName: "TestService", methods: {