{"size": 827, "ext": "js", "max_stars_repo_path": "src/context.spec.js", "max_stars_repo_name": "Intai/bdux", "max_stars_repo_stars_event_min_datetime": "2018-07-26T23:40:01.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-03T08:35:35.000Z", "max_issues_repo_path": "src/context.spec.js", "max_issues_repo_name": "Intai/bdux", "max_issues_repo_issues_event_min_datetime": "2019-12-27T08:46:15.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-11T10:49:19.000Z", "max_forks_repo_path": "src/context.spec.js", "max_forks_repo_name": "Intai/bdux", "max_forks_repo_forks_event_min_datetime": "2016-09-17T10:32:52.000Z", "max_forks_repo_forks_event_max_datetime": "2016-09-17T10:32:52.000Z"}
{"max_stars_count": 2, "max_issues_count": 11, "max_forks_count": 1, "avg_line_length": 25.0606060606, "max_line_length": 67, "alphanum_fraction": 0.6287787183}
/* eslint-env mocha */

import chai from 'chai'
import BduxContext, { defaultContextValue } from './context'

describe('Context', () => {

  it('should export a provider', () => {
    chai.expect(BduxContext).to.have.property('Provider')
  })

  it('should export a consumer', () => {
    chai.expect(BduxContext).to.have.property('Consumer')
  })

  it('should have dispatcher in the default context', () => {
    chai.expect(defaultContextValue).to.have.property('dispatcher')
      .to.be.an('object')
      .to.include.keys([
        'generateActionId',
        'getActionStream',
        'dispatchAction',
        'bindToDispatch'
      ])
  })

  it('should have a weak map to memoise store proeprties', () => {
    chai.expect(defaultContextValue).to.have.property('stores')
      .to.be.an.instanceof(WeakMap)
  })

})
