DefinitelyTyped/types/hubot/hubot-tests.ts
Andrew Webb ed5fcefc9c Expand hubot typings (#34916)
* Expand hubot typings

* Fix build issue

* Fix tests for mattvperrys hubot pr

* Update mattvperrys code after rebase

* Remove redundant line
2019-04-23 14:08:02 -05:00

20 lines
554 B
TypeScript

import * as Hubot from "hubot";
const robot = new Hubot.Robot<{}>(
'src/adapters',
'slack',
false,
'hubot',
);
robot; // $ExpectType Robot<{}>
robot.adapter; // $ExpectType {}
robot.hear(/hello/, () => null); // $ExpectType void
robot.on('test', () => null); // $ExpectType Robot<{}>
robot.emit('test', 'arg'); // $ExpectType boolean
const brain = new Hubot.Brain(robot);
brain; // $ExpectType Brain<{}>
brain.userForName('someone'); // $ExpectType User
brain.get('test'); // $ExpectType any
brain.set('test', 'test'); // $ExpectType Brain<{}>