Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Enzyme.configure({ adapter: new Adapter() });
function assertLength(length) {
return function $assertLength(selector) {
let result = this.find(selector);
expect(result).to.have.length(length);
return result;
};
}
ReactWrapper.prototype.assertSingle = assertLength(1);
ShallowWrapper.prototype.assertSingle = assertLength(1);
ReactWrapper.prototype.assertNone = assertLength(0);
ShallowWrapper.prototype.assertNone = assertLength(0);
beforeEach(() => {
/* eslint-disable no-console */
sinon.stub(console, 'error').callsFake(msg => {
let expected = false;
console.error.expected.forEach(about => {
if (msg.indexOf(about) !== -1) {
console.error.warned[about] = true;
expected = true;
}
});
if (expected) {
return;
}
import deprecated from 'prop-types-extra/lib/deprecated';
import { _resetWarned } from '../src/utils/deprecationWarning';
Enzyme.configure({ adapter: new Adapter() });
function assertLength(length) {
return function $assertLength(selector) {
let result = this.find(selector);
expect(result).to.have.length(length);
return result;
};
}
ReactWrapper.prototype.assertSingle = assertLength(1);
ShallowWrapper.prototype.assertSingle = assertLength(1);
ReactWrapper.prototype.assertNone = assertLength(0);
ShallowWrapper.prototype.assertNone = assertLength(0);
beforeEach(() => {
/* eslint-disable no-console */
sinon.stub(console, 'error').callsFake(msg => {
let expected = false;
console.error.expected.forEach(about => {
if (msg.indexOf(about) !== -1) {
console.error.warned[about] = true;
expected = true;
}
});
return result;
};
}
function print() {
return this.tap(f => console.log(f.debug()));
}
ReactWrapper.prototype.assertSingle = assertLength(1);
ShallowWrapper.prototype.assertSingle = assertLength(1);
ReactWrapper.prototype.assertNone = assertLength(0);
ShallowWrapper.prototype.assertNone = assertLength(0);
ReactWrapper.prototype.print = print;
ShallowWrapper.prototype.print = print;
chai.should();
chai.use(sinonChai);
global.expect = chai.expect;
global.assert = chai.assert;
beforeEach(() => {
sinon.stub(console, 'error').callsFake(msg => {
let expected = false;
console.error.expected.forEach(about => {
if (msg.indexOf(about) !== -1) {
console.error.warned[about] = true;
expected = true;
}
Enzyme.configure({ adapter: new Adapter() });
function assertLength(length) {
return function $assertLength(selector) {
let result = this.find(selector);
expect(result).to.have.length(length);
return result;
};
}
function print() {
return this.tap(f => console.log(f.debug()));
}
ReactWrapper.prototype.assertSingle = assertLength(1);
ShallowWrapper.prototype.assertSingle = assertLength(1);
ReactWrapper.prototype.assertNone = assertLength(0);
ShallowWrapper.prototype.assertNone = assertLength(0);
ReactWrapper.prototype.print = print;
ShallowWrapper.prototype.print = print;
chai.should();
chai.use(sinonChai);
global.expect = chai.expect;
global.assert = chai.assert;
beforeEach(() => {
sinon.stub(console, 'error').callsFake(msg => {
let expected = false;
return function $assertLength(selector) {
let result = this.find(selector);
expect(result).to.have.length(length);
return result;
};
}
function print() {
return this.tap(f => console.log(f.debug()));
}
ReactWrapper.prototype.assertSingle = assertLength(1);
ShallowWrapper.prototype.assertSingle = assertLength(1);
ReactWrapper.prototype.assertNone = assertLength(0);
ShallowWrapper.prototype.assertNone = assertLength(0);
ReactWrapper.prototype.print = print;
ShallowWrapper.prototype.print = print;
chai.should();
chai.use(sinonChai);
global.expect = chai.expect;
global.assert = chai.assert;
beforeEach(() => {
sinon.stub(console, 'error').callsFake(msg => {
let expected = false;
console.error.expected.forEach(about => {
if (msg.indexOf(about) !== -1) {
configure({ adapter: new Adapter() })
function assertLength(length) {
return function $assertLength(selector) {
let result = this.find(selector)
result.should.have.length(length)
return result
}
}
ReactWrapper.prototype.print = function print() {
console.log(this.debug())
return this
}
ReactWrapper.prototype.assertSingle = assertLength(1)
ShallowWrapper.prototype.assertSingle = assertLength(1)
ReactWrapper.prototype.assertNone = assertLength(0)
ShallowWrapper.prototype.assertNone = assertLength(0)
return function $assertLength(selector) {
let result = this.find(selector)
result.should.have.length(length)
return result
}
}
ReactWrapper.prototype.print = function print() {
console.log(this.debug())
return this
}
ReactWrapper.prototype.assertSingle = assertLength(1)
ShallowWrapper.prototype.assertSingle = assertLength(1)
ReactWrapper.prototype.assertNone = assertLength(0)
ShallowWrapper.prototype.assertNone = assertLength(0)