Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tape('hoc', async t => {
const TestToken1 = createToken('test-token-1');
const TestToken2 = createToken('test-token-2');
const TestToken3 = createToken('test-token-3');
const withTest = compose(
hoc.create('test1', undefined, TestToken1),
hoc.create('test2', undefined, TestToken2),
hoc.create('test3', provides => ({mapped: provides}), TestToken3)
);
const testProvides1 = {hello: 1};
const testProvides2 = {hello: 2};
const testProvides3 = {hello: 3};
let didRender = false;
function TestComponent(props) {
didRender = true;
t.deepLooseEqual(props.test1, testProvides1, 'works with plain plugin');
t.deepLooseEqual(
props.test2,
testProvides2,
'works with legacy PluginProvider'
);