简体   繁体   English

使用Hubot-Test-Helper和Jest测试Hubot

[英]Testing Hubot with hubot-test-helper and jest

I would like to test my hubot scripts, written in JavaScript, with the hubot-test-helper and jest. 我想用hubot-test-helper和jest 测试用JavaScript编写的hubot脚本。 The lack of documentation makes it really difficult though. 缺少文档使它确实非常困难。 I am looking for someone, who is willing to share a working test? 我正在寻找愿意分享工作测试的人?

I was having the same situation trying to test my bot with hubot-test-helper but with no luck, What I did was try it the same way they are doing in their testings, configuring mocha instead of jest and that works!. 我在尝试使用hubot-test-helper测试我的机器人时遇到相同的情况,但是没有运气,我所做的就是以与他们在测试中相同的方式进行尝试,配置了Mocha而不是开玩笑,并且有效! so Just review their package.json file and install and configure all as they did, then take the hello_world_test.js example and that should work. 因此,只需检查他们的package.json文件并按照其安装和配置的方式进行操作,然后以hello_world_test.js示例为例,这应该可以工作。 make sure you have a test folder at the same level of the package.json file (that's the quick way). 确保在package.json文件的同一级别上有一个测试文件夹(这是快速方法)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM