Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("registers built-in functions", () => {
// tslint:disable-next-line:no-console
const Comp: any = console.log;
Comp.type = defaultNS.ex("TestClass");
const [ registration ] = register(Comp);
expect(registration).toHaveProperty("component", Comp);
expect(registration).toHaveProperty("property", RENDER_CLASS_NAME.sI);
expect(registration).toHaveProperty("topology", DEFAULT_TOPOLOGY.sI);
expect(registration).toHaveProperty("type", defaultNS.ex("TestClass").sI);
});
it("registers a class component", () => {
class Comp extends Component {
public static type = defaultNS.ex("TestClass");
public render() { return null; }
}
const [ registration ] = register(Comp);
expect(registration).toHaveProperty("component", Comp);
expect(registration).toHaveProperty("property", RENDER_CLASS_NAME.sI);
expect(registration).toHaveProperty("topology", DEFAULT_TOPOLOGY.sI);
expect(registration).toHaveProperty("type", defaultNS.ex("TestClass").sI);
});