@aire-ux/aire-condensation
Version:
Client-side serialization library for Aire-UX
30 lines (22 loc) • 549 B
text/typescript
import { locate } from "@condensation/invoker";
import { Receive, Remotable } from "@condensation/index";
test("an invoker must locate a property correctly", () => {
class B {}
class A {
b: B | undefined;
}
let a = new A(),
b = new B();
a.b = b;
const [host, prop] = locate("b".split("."), a);
expect(host).toBe(a);
expect(prop).toBe(b);
});
test("ensure invoking a method makes sense", () => {
@Remotable
class A {
sayHello(@Receive(String) name: string): string {
return `Hello ${name}`;
}
}
});