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

Testing Improvements. #989

Merged
merged 5 commits into from Feb 20, 2018
Merged

Testing Improvements. #989

merged 5 commits into from Feb 20, 2018

Conversation

DylanPiercey
Copy link
Contributor

@DylanPiercey DylanPiercey commented Feb 16, 2018

Description

  • Setup utility to run jsdom tests in the same process without bundling.
  • Cleanup require hooks in test suite.
  • Test organization and cleanup.
  • Remove redundant autotest utilities.
  • Work towards running components-browser tests with hydration.
  • Remove lasso as a dev dependency.

Motivation and Context

Some bugs have been discovered around some hydration edge cases.
To improve the test coverage for hydration we want to have all of the components-browser tests run through a hydration step and a browser render step.

With the existing setup the process will run out of ram when bundling all of these tests (twice) because of the way lasso is caching things.

This PR has a WIP implementation to run the components browser tests in hydration mode using a new testing technique which removes the need for running browser tests through a bundler in order to run them.

This also makes the tests run much faster.

Screenshots (if appropriate):

screen shot 2018-02-15 at 4 57 19 pm

Checklist:

  • My code follows the code style of this project.
  • I have updated/added documentation affected by my changes.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

* Cleanup require hooks in test suite.
* Test organization and cleanup.
* Remove redundant autotest utilities.
@codecov
Copy link

codecov bot commented Feb 16, 2018

Codecov Report

Merging #989 into master will decrease coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #989      +/-   ##
==========================================
- Coverage   90.46%   90.29%   -0.18%     
==========================================
  Files         309      304       -5     
  Lines       11478    11473       -5     
==========================================
- Hits        10384    10359      -25     
- Misses       1094     1114      +20
Impacted Files Coverage Δ
src/components/boot.js 0% <0%> (-100%) ⬇️
src/components/legacy/dependencies/index.js 76.82% <0%> (-18.3%) ⬇️
src/components/index-browser.js 87.5% <0%> (-12.5%) ⬇️
src/components/registry-browser.js 91.17% <0%> (-5.89%) ⬇️
src/components/legacy/index-browser.js 95.83% <0%> (-4.17%) ⬇️
src/compiler/index.js 77.08% <0%> (-2.78%) ⬇️
index-browser.marko
components-browser.marko
ready.marko
jquery.marko
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecc7763...25ae8b4. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 90.29% when pulling 62ee3e5 on remove-lasso into ecc7763 on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 90.29% when pulling 62ee3e5 on remove-lasso into ecc7763 on master.

@coveralls
Copy link

coveralls commented Feb 16, 2018

Coverage Status

Coverage decreased (-0.2%) to 90.29% when pulling 25ae8b4 on remove-lasso into ecc7763 on master.

@@ -5,7 +5,7 @@ var markoWidgets = require('marko-widgets');
describe(path.basename(__dirname), function() {
it('should serialize widget config down to the browser', function() {

expect(window.simpleWidgets).to.equal(undefined);
expect(window.simpleWidgets).to.eql([]);
Copy link
Member

Choose a reason for hiding this comment

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

Why did this change to an empty array?

Copy link
Member

Choose a reason for hiding this comment

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

The tests used to run before the static component code:

They now run after, but it doesn't change the meaning of the tests. It's still saying the same thing: "expect there to be no simpleWidgets yet."

@@ -1,5 +1,3 @@
lasso-page dependencies=data.browserDependencies lasso=data.lasso

import Promise from 'promise-polyfill';
Copy link
Member

Choose a reason for hiding this comment

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

I notice you upgraded this module. Is it even needed?

I assume it was needed prior to the switch to JSDOM because Phantom didn't support Promises.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think you are right. I thought I saw a test that was testing specifically for a poly filled promise but I guess I was wrong. I updated to PR to remove this dependency.

@mlrawlings mlrawlings merged commit a7f529d into master Feb 20, 2018
@DylanPiercey DylanPiercey deleted the remove-lasso branch March 10, 2018 00:30
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.

None yet

4 participants