Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Oct 5, 2019
1 parent d1e6bbe commit 210799d
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new Adapter() });

function assertLength(length) {
return function $assertLength(selector) {
const assertLength = length =>
function $assertLength(selector) {
let result = this.find(selector);
expect(
result,
Expand All @@ -16,25 +16,13 @@ function assertLength(length) {
).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;
ReactWrapper.prototype.printDOM = function printDOM() {
return this.tap(f => console.log(f.html()));
};

ShallowWrapper.prototype.print = print;

beforeEach(() => {
sinon.stub(console, 'error').callsFake((msg, ...args) => {
let expected = false;
Expand Down

0 comments on commit 210799d

Please sign in to comment.