Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,30 @@
// @flow weak
function shallowRecursively(wrapper, selector, { context, ...other }) {
if (wrapper.isEmptyRender() || typeof wrapper.getElement().type === 'string') {
return wrapper;
}
let newContext = context;
const instance = wrapper.root().instance();
// The instance can be null with a stateless functional component and react >= 16.
if (instance && instance.getChildContext) {
newContext = {
...context,
...instance.getChildContext(),
};
}
const nextWrapper = wrapper.shallow({ context: newContext, ...other });
if (selector && wrapper.is(selector)) {
return nextWrapper;
}
return shallowRecursively(nextWrapper, selector, { context: newContext });
}
export default function until(selector, options = {}) {
return this.single('until', () => shallowRecursively(this, selector, options));
}