hubot 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hubot",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "author": "hubot",
5
5
  "keywords": [
6
6
  "github",
@@ -17,6 +17,11 @@ const historyPath = '.hubot_history'
17
17
  const bold = str => `\x1b[1m${str}\x1b[22m`
18
18
 
19
19
  class Shell extends Adapter {
20
+ constructor (robot) {
21
+ super(robot)
22
+ this.name = 'Shell'
23
+ }
24
+
20
25
  send (envelope/* , ...strings */) {
21
26
  const strings = [].slice.call(arguments, 1)
22
27
 
package/src/robot.js CHANGED
@@ -66,7 +66,7 @@ class Robot {
66
66
  this.setupNullRouter()
67
67
  }
68
68
 
69
- this.adapterName = adapter
69
+ this.adapterName = adapter ?? 'shell'
70
70
  this.errorHandlers = []
71
71
 
72
72
  this.on('error', (err, res) => {
@@ -1083,6 +1083,23 @@ describe('Robot', function () {
1083
1083
  })
1084
1084
  })
1085
1085
 
1086
+ describe('Robot Defaults', () => {
1087
+ let robot = null
1088
+ beforeEach(async () => {
1089
+ process.env.EXPRESS_PORT = 0
1090
+ robot = new Robot(null, true, 'TestHubot')
1091
+ robot.alias = 'Hubot'
1092
+ await robot.loadAdapter()
1093
+ robot.run()
1094
+ })
1095
+ afterEach(() => {
1096
+ robot.shutdown()
1097
+ })
1098
+ it('should load the builtin shell adapter by default', async () => {
1099
+ expect(robot.adapter.name).to.equal('Shell')
1100
+ })
1101
+ })
1102
+
1086
1103
  describe('Robot ES6', () => {
1087
1104
  let robot = null
1088
1105
  beforeEach(async () => {