@tsed/schema
Version:
JsonSchema module for Ts.ED Framework
28 lines (23 loc) • 726 B
text/typescript
import "../../index.js";
import {OperationVerbs} from "../../constants/OperationVerbs.js";
import {inspectOperationsPaths} from "../../domain/__fixtures__/inspectOperationsPaths.js";
import {JsonEntityStore} from "../../domain/JsonEntityStore.js";
import {Publish} from "./publish.js";
describe("Publish", () => {
it("should register operation with Publish verb", () => {
// WHEN
class Test {
("event")
test() {}
}
const endpoint = JsonEntityStore.fromMethod(Test, "test");
// THEN
expect(inspectOperationsPaths(endpoint)).toEqual([
{
method: OperationVerbs.PUBLISH,
path: "event"
}
]);
expect(endpoint.propertyKey).toBe("test");
});
});