Skip to content
This repository was archived by the owner on May 17, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,41 @@
"./dist/browser.es2015.es.js": "./dist/browser.es2017.es.js"
},
"dependencies": {
"fusion-plugin-rpc": "^2.1.3",
"fusion-plugin-rpc": "^2.3.0-0",
"fusion-rpc-redux": "^1.2.0",
"prop-types": "^15.6.1"
},
"peerDependencies": {
"fusion-core": "^1.2.6",
"fusion-react": "^1.1.0",
"fusion-react": "^1.3.4-0",
"react": "14.x - 16.x"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"create-universal-package": "^3.4.6",
"eslint": "^5.6.1",
"eslint": "^5.9.0",
"eslint-config-fusion": "^4.0.0",
"eslint-plugin-cup": "^2.0.0",
"eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.24.1",
"eslint-plugin-jest": "^22.0.0",
"eslint-plugin-prettier": "^3.0.0",
"eslint-plugin-react": "^7.11.1",
"flow-bin": "^0.83.0",
"fusion-core": "^1.7.0",
"fusion-plugin-universal-events": "^1.2.0",
"fusion-react": "^1.3.0",
"fusion-test-utils": "^1.2.3",
"fusion-tokens": "^1.1.0",
"nyc": "^13.0.1",
"prettier": "1.14.3",
"flow-bin": "^0.86.0",
"fusion-core": "^1.10.0",
"fusion-plugin-universal-events": "^1.3.0",
"fusion-react": "^1.3.4-0",
"fusion-test-utils": "^1.2.4",
"fusion-tokens": "^1.1.1",
"nyc": "^13.1.0",
"prettier": "1.15.2",
"prop-types": "^15.6.1",
"react": "^16.5.2",
"react-dom": "16.6.0",
"react-redux": "^5.0.7",
"react-test-renderer": "^16.5.2",
"redux": "4.0.0",
"react": "^16.6.3",
"react-dom": "16.6.3",
"react-redux": "^5.1.1",
"react-test-renderer": "^16.6.3",
"redux": "4.0.1",
"redux-reactors": "^1.0.3",
"tape-cup": "^4.7.1",
"unitest": "^2.1.1"
Expand Down
36 changes: 16 additions & 20 deletions src/__tests__/index.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ test('browser plugin integration test withRPCRedux', async t => {
const withTest = compose(
withRPCRedux('test'),
connect(s => s),
prepared(
props => (props.a ? Promise.resolve() : props.test({hello: 'world'}))
prepared(props =>
props.a ? Promise.resolve() : props.test({hello: 'world'})
)
)(Component);

Expand Down Expand Up @@ -159,9 +159,8 @@ test('browser plugin integration test withRPCRedux - failure', async t => {
const withTest = compose(
withRPCRedux('test'),
connect(s => s),
prepared(
props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
prepared(props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
)
)(Component);

Expand Down Expand Up @@ -216,8 +215,8 @@ test('browser mock integration test withRPCRedux', async t => {
const withTest = compose(
withRPCRedux('test'),
connect(s => s),
prepared(
props => (props.a ? Promise.resolve() : props.test({hello: 'world'}))
prepared(props =>
props.a ? Promise.resolve() : props.test({hello: 'world'})
)
)(Component);

Expand Down Expand Up @@ -280,9 +279,8 @@ test('browser mock integration test withRPCRedux - failure', async t => {
const withTest = compose(
withRPCRedux('test'),
connect(s => s),
prepared(
props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
prepared(props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
)
)(Component);

Expand Down Expand Up @@ -374,8 +372,8 @@ test('browser plugin integration test withRPCReactor', async t => {
return {};
},
}),
prepared(
props => (props.a ? Promise.resolve() : props.test({hello: 'world'}))
prepared(props =>
props.a ? Promise.resolve() : props.test({hello: 'world'})
),
connect(s => s)
);
Expand Down Expand Up @@ -460,8 +458,8 @@ test('browser mock plugin integration test withRPCReactor', async t => {
return {};
},
}),
prepared(
props => (props.a ? Promise.resolve() : props.test({hello: 'world'}))
prepared(props =>
props.a ? Promise.resolve() : props.test({hello: 'world'})
),
connect(s => s)
);
Expand Down Expand Up @@ -557,9 +555,8 @@ test('browser plugin integration test withRPCReactor - failure', async t => {
};
},
}),
prepared(
props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
prepared(props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
),
connect(s => s)
);
Expand Down Expand Up @@ -669,9 +666,8 @@ test('browser plugin integration test withRPCReactor - failure 2', async t => {
};
},
}),
prepared(
props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
prepared(props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
),
connect(s => s)
);
Expand Down
13 changes: 11 additions & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import PropTypes from 'prop-types';

import {ProviderPlugin} from 'fusion-react';
import rpc, {mock as RPCMock} from 'fusion-plugin-rpc';
import type {RPCType, RPCDepsType} from 'fusion-plugin-rpc';

class RPCProvider extends React.Component<*> {
rpc: typeof rpc;
Expand All @@ -31,5 +32,13 @@ RPCProvider.childContextTypes = {
rpc: PropTypes.object.isRequired,
};

export default ProviderPlugin.create('rpc', rpc, RPCProvider);
export const mock = ProviderPlugin.create('rpc', RPCMock, RPCProvider);
export default ProviderPlugin.create<RPCDepsType, RPCType>(
'rpc',
rpc,
RPCProvider
);
export const mock = ProviderPlugin.create<RPCDepsType, RPCType>(
'rpc',
RPCMock,
RPCProvider
);
Loading