Coder Social home page Coder Social logo

Comments (4)

gandadil avatar gandadil commented on May 26, 2024

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

from scuri.

gparlakov avatar gparlakov commented on May 26, 2024

It looks like 2 issues described here. Let me start by the second:

  1. Seems that you need to use the --legacy flag, see AutoSpy point. In short:
  • ng g scuri:autospy --for jest --legacy would generate a ts<2.8 jest compatible autoSpy type and function ng g scuri:autospy would generate a ts>2.8 jasmine compatible autoSpy type and function
  • replace the existing autospy.ts with this one, supporting older ts version
  1. 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?

from scuri.

gparlakov avatar gparlakov commented on May 26, 2024

@gandadil what do you think about my suggestion above?

from scuri.

gparlakov avatar gparlakov commented on May 26, 2024

@gandadil Closing this...

from scuri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.