如何使用sinon和mocha在MySQL查询节点上模拟Promisify调用?

问题描述这是我使用MySQL的代码-import*asmysqlfrom'mysql';import{promisify}from'util';constconnectionParams:any={/*setasenvironmentvariables*/host:host,us

发布:2022-10-16 标签:node.jsmysqlstubsinonmocha.js


测试后清除SINON存根

问题描述我的一个测试中有此存根:sinon.stub(service,'batchNote').resolves(mResponse);测试后能不能把它清理掉?如果是,如何?推荐答案是的,有可能。SinonAPI有restore方法用于stubs。来自docs调用object.m

发布:2022-10-16 标签:javascriptnode.jsstubsinon


由于对所需库 rt.jar 的限制,对类的访问限制?

问题描述我正在尝试编译IBM的WSDL2Java在Java5上创建的Java1.4代码,而无需重新创建存根并在Eclipse中看到此错误.我假设只要运行时jars可用(它们是),生成的存根就应该编译.I'mattemptingtocompileJava1.4codethatwas

发布:2022-10-16 标签:eclipsejavawsdlstubwsdl2java


仅在 Intellij 调试器中检测到 Mockito 未完成的存根异常

问题描述仅当我尝试通过IntelliJ调试器调试测试时才会出现此问题.当我只是简单地运行测试时,它不会发生.TheproblemonlyoccurswhenIamtryingtodebugatestviatheIntelliJdebugger.Itdoesnothappenwhe

发布:2022-10-16 标签:debuggingstubintellij-ideaspring-bootmockito


使用 Jasmine 在 JavaScript 中存根 WebSocket

问题描述我尝试测试onmessage是否是一个正确的函数.Itrytotestifonmessageisaproperfunction.这是一个测试:describe(".init(address,window)",function(){beforeEach(function()

发布:2022-10-16 标签:javascriptwebsockettestingstubjasmine


“重复的文件名"使用来自不同子域的 Web 服务时用于相同的 WSDL 命名空间

问题描述前言我们正在向客户提供我们的服务API.每个客户都有自己的子域(例如sergii.ourwebsite.com)和自己的WSDLURL,它看起来像http://sergii.ourwebsite.com/api/bsapi.cfc?wsdl此外,所有网站(当然包括API)

发布:2022-10-16 标签:coldfusionwsdlstub


什么时候期待什么时候存根?

问题描述我使用NMock2,并起草了以下NMock类来表示一些常见的模拟框架概念:IuseNMock2,andI'vedraftedthefollowingNMockclassestorepresentsomecommonmockframeworkconcepts:Expect:

发布:2022-10-16 标签:tddmockingstubexpectnmock


防止equals方法的存根

问题描述我想测试我的班级的equals()方法,但Mockito似乎每次都在调用存根版本.我的测试如下;Iwouldliketotestmyclass'equals()methodbutMockitoseemstobecallingthestubversioneverytime.

发布:2022-10-16 标签:methodsequalsmockingstubmockito


Spock测试框架中Mock/Stub/Spy之间的区别

问题描述我不明白Spock测试中Mock、Stub和Spy之间的区别,并且我一直在网上查看的教程没有详细解释它们.Idon'tunderstandthedifferencebetweenMock,Stub,andSpyinSpocktestingandthetutorialsIh

发布:2022-10-16 标签:testingmockingstubspockspy


模拟和模拟有什么区别?存根?

问题描述我阅读了各种关于测试中的模拟与存根的文章,包括MartinFowler的模拟不是存根,但还是不明白其中的区别.I'vereadvariousarticlesaboutmockingvsstubbingintesting,includingMartinFowler'sMoc

发布:2022-10-16 标签:testingmockingstub