<commit_before>React       = require 'react'
merge       = require 'lodash/merge'
TestBackend = require('react-dnd-test-backend').default
TestRouter  = require './test-router'
{DragDropManager} = require 'dnd-core'


EnzymeContext =

  withDnD: (options = {}) ->
    context = @build(options)
    merge(context, {
      context:
        dragDropManager: new DragDropManager(TestBackend)
      childContextTypes:
        dragDropManager: React.PropTypes.object
    })

  build: (options = {}) ->
    merge({
      context:
        router: new TestRouter()
        broadcasts: { location: (cb) -> cb(pathname: (options.pathname or '/')) }
      childContextTypes:
        broadcasts: React.PropTypes.object
        router: React.PropTypes.object
    }, options)

module.exports = EnzymeContext
<commit_msg>forward path to router stub<commit_after>React       = require 'react'
merge       = require 'lodash/merge'
TestBackend = require('react-dnd-test-backend').default
TestRouter  = require './test-router'
{DragDropManager} = require 'dnd-core'


EnzymeContext =

  withDnD: (options = {}) ->
    context = @build(options)
    merge(context, {
      context:
        dragDropManager: new DragDropManager(TestBackend)
      childContextTypes:
        dragDropManager: React.PropTypes.object
    })

  build: (options = {}) ->
    merge({
      context:
        router: new TestRouter(options.pathname or '/')
        broadcasts: { location: (cb) -> cb(pathname: (options.pathname or '/')) }
      childContextTypes:
        broadcasts: React.PropTypes.object
        router: React.PropTypes.object
    }, options)

module.exports = EnzymeContext

{'fraction_non_alphanumeric': 0.12401215805471125, 'fraction_numerical': 0.0, 'mean_word_length': 2.947242206235012, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3013958', 'n_tokens_mistral': 490, 'n_tokens_neox': 487, 'n_words': 101}