1 |
|
2 |
|
3 |
|
4 |
|
5 | 'use strict';
|
6 |
|
7 | var dispatchr = require('dispatchr');
|
8 | var MockActionContextClass = require('./MockActionContext');
|
9 |
|
10 | module.exports = function createMockActionContext(options) {
|
11 | options = options || {};
|
12 | options.mockActionContextClass = options.mockActionContextClass || MockActionContextClass;
|
13 | options.stores = options.stores || [];
|
14 | options.dispatcher = options.dispatcher || dispatchr.createDispatcher({
|
15 | stores: options.stores
|
16 | });
|
17 | options.dispatcherContext = options.dispatcherContext || options.dispatcher.createContext();
|
18 |
|
19 | return new options.mockActionContextClass(options.dispatcherContext);
|
20 | };
|