mockdeep / typewiz

Automatically discover and add missing types in your TypeScript code

Home Page:https://medium.com/@urish/manual-typing-is-no-fun-introducing-typewiz-58e3e8813f4c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arrow functions with concise body not instrumented correctly

urish opened this issue · comments

For instance, a function that reads x => 5 will be transformed to x => { $_$twiz(/*...*/); 5 } , which returns undefined and not 5.

Failing integration test case:

it('should correctly transform arrow functions that return arrow functions', () => {
  const input = `(x=>y=>x+y)(10)(5)`;
  expect(typeWiz(input)).toBe(`((x: number)=>(y: number)=>x+y)(10)(5)`);
});