Skip to content

Rewrite some tests to no longer rely on internals#2132

Merged
marvinhagemeister merged 6 commits into
masterfrom
fix/reduce-internals-in-tests
Nov 15, 2019
Merged

Rewrite some tests to no longer rely on internals#2132
marvinhagemeister merged 6 commits into
masterfrom
fix/reduce-internals-in-tests

Conversation

@andrewiggins

@andrewiggins andrewiggins commented Nov 15, 2019

Copy link
Copy Markdown
Member

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

expect(child._vnode._dom).to.equalNode(child.base);
});

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

Copy link
Copy Markdown
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.

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

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

Copy link
Copy Markdown
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

coveralls commented Nov 15, 2019

Copy link
Copy Markdown

Coverage Status

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

@cristianbote cristianbote left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 really love this :)

@marvinhagemeister marvinhagemeister left a comment

Copy link
Copy Markdown
Member

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