hubotio / hubot

A customizable life embetterment robot.

Home Page:https://hubotio.github.io/hubot/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hubot-test-helper broke due to change to Robot constructor

vpeltola opened this issue ยท comments

Hi!
I use hubot-test-helper for unit testing, which broke due the following recent commit:

d1cabd5

This removed "adapterPath" from the argument list:

- constructor (adapterPath, adapter, httpd, name, alias) {
+ constructor (adapter, httpd, name, alias) {

hubot-test-helper creates a mock Robot instance by calling super(null, null, httpd, 'hubot'); but this is now wrong as the httpd argument should be the 2nd argument. See https://github.com/mtsmfm/hubot-test-helper/blob/37b5e99faa2023c95d88c420b2b3bb1f09dd07b1/src/index.js#L20C5-L20C39

I created a PR for hubot-test-helper: https://github.com/mtsmfm/hubot-test-helper/pull/62/files
However, hubot-test-helper hasn't been receiving updates in a long time, and I don't know if anyone is maintaining it.

Also, the "es2015.js" file which is used by hubot-test-helper, hasn't been updated to call Robot() with the new 4 arguments, so that needs to be updated as well. https://github.com/hubotio/hubot/blob/v5.0.7/es2015.js

  loadBot (adapterPath, adapterName, enableHttpd, botName, botAlias) {
    return new module.exports.Robot(adapterPath, adapterName, enableHttpd, botName, botAlias)
  }

๐ŸŽ‰ This issue has been resolved in version 6.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

Do you think you can move away from hubot-test-helper? https://github.com/hubotio/hubot/tree/main/test/fixtures has some example Mock Adapters.

Thanks for the quick update! I will review the Mock Adapters as well,