Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return wrapper
}
//
// console.log(wrapper.getElement().type);
// console.log(selector);
return selector && wrapper.is(selector)
? wrapper.dive()
: shallowRecursively(wrapper.dive(), selector)
}
function until(selector) {
return this.single('until', () => shallowRecursively(this, selector))
}
ShallowWrapper.prototype.until = until
if (!child.children().length) {
if (child.getElement()) {
return '' // empty element with no children
}
return child.text() // text content
}
return textRecursively(child) // element has child nodes
})
.join('')
}
function textOnly() {
return this.single('textOnly', () => textRecursively(this))
}
ShallowWrapper.prototype.textOnly = textOnly
process.env.PUBLIC_URL = ''
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err
})
// Ensure environment variables are read.
require('../config/env')
configure({ adapter: new Adapter() })
// This allows jest testing to find the Base Component in a HOC.
ShallowWrapper.prototype.until = until
function storageMock () {
var storage = {}
return {
setItem: function (key, value) {
storage[key] = value || ''
},
getItem: function (key) {
return key in storage ? storage[key] : null
},
removeItem: function (key) {
delete storage[key]
},
get length () {
return Object.keys(storage).length