Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Commit

Permalink
refactor: flow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfreedman committed Mar 19, 2017
1 parent 690d43a commit a3563f0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[ignore]
.*/node_modules/config-chain/.*
.*/node_modules/findup/.*
.*/node_modules/npmconf/.*

[include]

Expand Down
2 changes: 1 addition & 1 deletion test/adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let assert = require('chai').assert;
import {describe, it, beforeEach, afterEach} from 'mocha';
import SymphonyAdapter from '../src/adapter';
import NockServer from './nock-server';
import {FakeRobot} from './fakes';
import FakeRobot from './fakes';

process.env['HUBOT_SYMPHONY_HOST'] = 'foundation.symphony.com';
process.env['HUBOT_SYMPHONY_PUBLIC_KEY'] = './test/resources/publicKey.pem';
Expand Down
7 changes: 3 additions & 4 deletions test/fakes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class FakeRobot extends EventEmitter {
users: Map<string, User>;
brain: Object;
received: Array<Object>;
Response: Response;

constructor() {
super();
Expand Down Expand Up @@ -89,12 +90,10 @@ class FakeRobot extends EventEmitter {
logger[level](message);
}

receive(msg: object) {
receive(msg: Object) {
this.received.push(msg);
super.emit('received');
}
}

module.exports = {
FakeRobot
};
module.exports = FakeRobot;
12 changes: 6 additions & 6 deletions test/nock-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ const logger: Log = new Log(process.env.HUBOT_SYMPHONY_LOG_LEVEL || process.env.

type ConstructorArgs = {
host: string,
kmHost: ?string,
agentHost: ?string,
sessionAuthHost: ?string,
startWithHelloWorldMessage: ?boolean
kmHost?: string,
agentHost?: string,
sessionAuthHost?: string,
startWithHelloWorldMessage?: boolean
}

class NockServer extends EventEmitter {
messages: Array<object>;
messages: Array<Object>;
host: string;
streamId: string;
firstMessageTimestamp: number;
Expand Down Expand Up @@ -218,7 +218,7 @@ class NockServer extends EventEmitter {
nock.cleanAll();
}

_receiveMessage(msg: String) {
_receiveMessage(msg: Object) {
logger.debug(`Received ${JSON.stringify(msg)}`);
this.messages.push(msg);
super.emit('received');
Expand Down
2 changes: 1 addition & 1 deletion test/symphony-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {TextListener} from 'hubot';
import Symphony from '../src/symphony';
import {V2Message} from '../src/message';
import NockServer from './nock-server';
import {FakeRobot} from './fakes';
import FakeRobot from './fakes';

describe('On-premise key manager / agent', () => {
let nock: NockServer;
Expand Down

0 comments on commit a3563f0

Please sign in to comment.