diff --git a/packages/enzyme-test-suite/test/ReactWrapper-spec.jsx b/packages/enzyme-test-suite/test/ReactWrapper-spec.jsx index 60ba04e38..2dd462fbb 100644 --- a/packages/enzyme-test-suite/test/ReactWrapper-spec.jsx +++ b/packages/enzyme-test-suite/test/ReactWrapper-spec.jsx @@ -747,7 +747,13 @@ describeWithDOM('mount', () => { expect(handleRender.args[1][1]).to.equal('update'); }); - it.skip('measures timings', () => { + it('measures timings', () => { + /** + * test environment has no access to the performance API at which point + * the profiling API has to fallback to Date.now() which isn't precise enough + * which results in 0 duration for these simple examples most of the time. + * With performance API it should test for greaterThan(0) instead of least(0) + */ const handleRender = sinon.spy(); function SomeComponent() { return ( @@ -759,13 +765,13 @@ describeWithDOM('mount', () => { const wrapper = mount(); expect(handleRender).to.have.property('callCount', 1); - expect(handleRender.args[0][2]).to.be.greaterThan(0); - expect(handleRender.args[0][3]).to.be.greaterThan(0); + expect(handleRender.args[0][2]).to.be.least(0); + expect(handleRender.args[0][3]).to.be.least(0); wrapper.setProps({ unusedProp: true }); expect(handleRender).to.have.property('callCount', 2); - expect(handleRender.args[1][2]).to.be.greaterThan(0); - expect(handleRender.args[1][3]).to.be.greaterThan(0); + expect(handleRender.args[1][2]).to.be.least(0); + expect(handleRender.args[1][3]).to.be.least(0); }); });