Coder Social home page Coder Social logo

Comments (5)

unlight avatar unlight commented on June 3, 2024
node_modules/jasmine-mock-factory/src/lib/index.ts:82:41 - error TS2345: Argument of type 'keyof T' is not assignable to parameter of type 'string'.
  Type 'string | number | symbol' is not assignable to type 'string'.
    Type 'number' is not assignable to type 'string'.

82                     this.ensureProperty(propertyName);
                                           ~~~~~~~~~~~~


node_modules/jasmine-mock-factory/src/lib/index.ts:85:41 - error TS2345: Argument of type 'keyof T' is not assignable to parameter of type 'string'.

85                     this.ensureFunction(propertyName);
                                           ~~~~~~~~~~~~


node_modules/jasmine-mock-factory/src/lib/index.ts:92:37 - error TS2345: Argument of type 'keyof T' is not assignable to parameter of type 'string'.

92                 this.ensureProperty(propertyName);
                                       ~~~~~~~~~~~~

from jasmine-mock-factory.

unlight avatar unlight commented on June 3, 2024

@chuanqisun

from jasmine-mock-factory.

chuanqisun avatar chuanqisun commented on June 3, 2024

Thank you @Wardrium for the report and @unlight for looking into it. I'm working on a fix.

from jasmine-mock-factory.

chuanqisun avatar chuanqisun commented on June 3, 2024

done! 2.1.0 release should get this patched. Let me know if you still see any errors after the update.

Thank you!

from jasmine-mock-factory.

chuanqisun avatar chuanqisun commented on June 3, 2024

I also noticed michael-silva forked the library and fixed the issue with a slightly different approach. Kudos to the community!

That fork should prevent the ts compiler error but didn't address the root cause. If someone actually uses a symbol as the property name, the test will break. My fix added the error checking and warning message when symbols are used.

from jasmine-mock-factory.

Related Issues (6)

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.