{"size": 603, "ext": "js", "max_stars_repo_path": "test/offset/index.js", "max_stars_repo_name": "24i/vigour_hub.js", "max_stars_repo_stars_event_min_datetime": "2016-12-20T14:56:35.000Z", "max_stars_repo_stars_event_max_datetime": "2019-10-14T10:59:40.000Z", "max_issues_repo_path": "test/offset/index.js", "max_issues_repo_name": "24i/vigour_hub.js", "max_issues_repo_issues_event_min_datetime": "2016-12-16T11:57:05.000Z", "max_issues_repo_issues_event_max_datetime": "2018-01-07T21:25:14.000Z", "max_forks_repo_path": "test/offset/index.js", "max_forks_repo_name": "24i/vigour_hub.js", "max_forks_repo_forks_event_min_datetime": "2017-05-04T19:28:09.000Z", "max_forks_repo_forks_event_max_datetime": "2018-06-14T12:55:11.000Z"}
{"max_stars_count": 114, "max_issues_count": 136, "max_forks_count": 6, "avg_line_length": 21.5357142857, "max_line_length": 53, "alphanum_fraction": 0.5771144279}
const hub = require('../../')
const test = require('tape')
const child = require('child_process')

test('subscription - time offset', t => {
  const spawned = child.fork('./test/offset/client')
  process.on('exit', () => spawned.kill('SIGINT'))
  const server = hub({ _uid_: 'server', port: 6060 })
  server.set({
    lolcats: true,
    lolcats2: true
  })
  var cnt = 0

  const done = (val) => {
    if (val && cnt === 1) {
      t.pass('receives lol cats')
      server.set(null)
      spawned.kill('SIGINT')
      t.end()
    }
    cnt++
  }

  server.lolcats.on(done)
  server.lolcats2.on(done)
})
