{"action":"opened","issue":{"url":"https://api.github.com/repos/rwaldron/johnny-five/issues/950","labels_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/950/labels{/name}","comments_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/950/comments","events_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/950/events","html_url":"https://github.com/rwaldron/johnny-five/issues/950","id":114433436,"number":950,"title":"move newBoard() into MockFirmata or otherwise export?","user":{"login":"boneskull","id":924465,"avatar_url":"https://avatars.githubusercontent.com/u/924465?v=3","gravatar_id":"","url":"https://api.github.com/users/boneskull","html_url":"https://github.com/boneskull","followers_url":"https://api.github.com/users/boneskull/followers","following_url":"https://api.github.com/users/boneskull/following{/other_user}","gists_url":"https://api.github.com/users/boneskull/gists{/gist_id}","starred_url":"https://api.github.com/users/boneskull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boneskull/subscriptions","organizations_url":"https://api.github.com/users/boneskull/orgs","repos_url":"https://api.github.com/users/boneskull/repos","events_url":"https://api.github.com/users/boneskull/events{/privacy}","received_events_url":"https://api.github.com/users/boneskull/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-31T20:47:00Z","updated_at":"2015-10-31T20:47:00Z","closed_at":null,"body":"This might be helpful for libs leveraging j5.\r\n\r\nTo use `MockFirmata` in integration tests, to ready the `Board`, one must:\r\n\r\n1.  pass a `MockFirmata` instance as the `io` prop to the `Board` constructor.\r\n2.  cause `MockFirmata` to emit events `ready` and `connect`.\r\n\r\nAll libraries will need to take these steps when writing integration tests.  Currently, you must implement this yourself, but `newBoard()` (from `test/board.js`) does this.  It would be helpful if this was exported, perhaps as a static method of `MockFirmata`; otherwise test-writers must `require()` two separate modules.\r\n\r\nIt may also be possible to do something like this in the `MockFirmata` constructor to avoid the extra steps:\r\n\r\n```js\r\n// untested\r\nprocess.nextTick(function() {\r\n  this.emit('connect');\r\n  this.emit('ready');\r\n}.bind(this))\r\n```\r\n\r\nSee #949 as well."}}