GithubHelp home page GithubHelp logo

Comments (5)

mjhgithub avatar mjhgithub commented on May 2, 2024

如果放宽测试类名,给testable-mock开发带来更高的复杂度和稳定性问题,那得不偿失。其实只要将约定规范提前说明,大家遵循使用也没有问题,我已经看到文档中有说明了,赞!

from testable-mock.

linfan avatar linfan commented on May 2, 2024

先整体Review看下�影响程度~ 肯定是在不影响稳定性的前提下哦

from testable-mock.

zcglisp avatar zcglisp commented on May 2, 2024

"测试类与被测类的包路径应相同",去掉这个约定也在本issues的考虑范围内吗?
被测类调用的类如果不在此包中,现在(0.4.7)还无法mock。
被测类调用的类如果在此包中,现在(0.4.7)可以mock。

from testable-mock.

linfan avatar linfan commented on May 2, 2024

因为Mock定义在测试类中,但Mock需要在运行时自动生效到被测类里,所以两者之间始终需要有某种方式能关联上。
目前是只能通过同包+名字约定来关联,未来会增加其他可选的关联方式,比如通过注解标识。

这修改计划是放到0.5版本之后,在0.5版本需要解决“常见问题”里第8条提到的问题,会对现在的Mock的底层实现机制做一些调整(保持使用体验基本不变),在设计的时候也会为这个Issue做准备。

from testable-mock.

linfan avatar linfan commented on May 2, 2024

0.5.0版本已发布。
参见文档 https://alibaba.github.io/testable-mock/#/zh-cn/doc/use-mock-with

from testable-mock.

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.