Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite some tests to no longer rely on internals #2132

Merged
merged 6 commits into from
Nov 15, 2019

Conversation

andrewiggins
Copy link
Member

@andrewiggins andrewiggins commented Nov 15, 2019

This is a stepping stone to allowing us to run tests against minified builds

  • Rewrite event tests to not rely on internal _listeners
  • Fix lazy ref test to not rely on internals
  • Rewrite teardown tests to not rely on internals
  • Remove src import from test helpers

@@ -1809,24 +1795,6 @@ describe('Components', () => {
expect(child._vnode._dom).to.equalNode(child.base);
});

it('should update old dom on forceUpdate in a lifecycle', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just moved this test into the forceUpdate describe section below.

} from '../_util/helpers';
import { div, span, p } from '../_util/dom';

/** @jsx createElement */
const h = createElement;

let spyAll = obj => Object.keys(obj).forEach(key => sinon.spy(obj, key));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this copy of the spyAll function and replaced it with the same function declared in helpers.js. Same for sortAttributes below

@coveralls
Copy link

coveralls commented Nov 15, 2019

Coverage Status

Coverage increased (+0.1%) to 100.0% when pulling 961366d on fix/reduce-internals-in-tests into 9ef3c33 on master.

Copy link
Member

@cristianbote cristianbote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 really love this :)

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top notch as usual 🙌💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants