it("works on class methods", () => {
class TestClass {
// NOTE: decorators are applied in *reverse*, so these are switched on purpose (when compared to bare function test)
// brittle? what's that
@route("/bar", "post")
@route("/foo", "get")
testFunction() {}
}
const [fooRoute, barRoute] = getRoutes(TestClass.prototype.testFunction);
expect(fooRoute).toMatchObject({ path: "/foo", method: "get" });
expect(barRoute).toMatchObject({ path: "/bar", method: "post" });
});