Closed gandadil closed 4 years ago
I commented the lines with error on spec above and run the tests. I receive this message:
Error: src/auto-spy.ts(14,36): error TS1005: ';' expected. src/auto-spy.ts(14,89): error TS1128: Declaration or statement expected. src/auto-spy.ts(14,90): error TS1109: Expression expected. src/auto-spy.ts(14,91): error TS1109: Expression expected.
The line with error is:
type SpyOf<T> = T &
Partial<{ [k in keyof T]: T[k] extends (...args: any[]) => any ? jasmine.Spy : T[k] }>;
I am using Angular 5, typescript 2.6.0, jasmine 3.4.0
It looks like 2 issues described here. Let me start by the second:
Seems that you need to use the --legacy
flag, see AutoSpy point. In short:
Seems, you expect SCuri to place parameter(s) in the methods that need parameters. Correct me if I am wrong, please.
it('when getDocumentoPlaceHolder is called it should', () => {
// arrange
const { build } = setup().default();
const c = build();
// act
c.getDocumentoPlaceHolder(/* SCuri, add parameer here */);
// assert
// expect(c).toEqual
});
How would that look like? And why would SCuri try to do that? SCuri's purpose is to help with boilerplate, not actually finish the logic of the unit test. What do you think?
@gandadil what do you think about my suggestion above?
@gandadil Closing this...
Some methods have parameters but on spec created by SCuri no parameters is passed. Here is the original TS:
and here is the SPEC, with errors on getDocumentoPlaceHolder, changeDocumentoSelecionado and keyEvent methods.