Skip to content

test(client): check console.log #1907

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

Merged
merged 1 commit into from
May 29, 2019
Merged

Conversation

hiroppy
Copy link
Member

@hiroppy hiroppy commented May 19, 2019

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

yes

Motivation / Use-Case

Just testing console.log of the client's code.

Breaking Changes

no

Additional Info

Maybe liveReload has a bug... see the snapshot.

@hiroppy hiroppy requested a review from alexander-akait as a code owner May 19, 2019 19:58
setTimeout(() => {
expect(res).toMatchSnapshot();
browser.close().then(resolve);
}, 3000);
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe here is flaky tests.

@codecov
Copy link

codecov bot commented May 19, 2019

Codecov Report

Merging #1907 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1907   +/-   ##
=======================================
  Coverage   87.96%   87.96%           
=======================================
  Files          15       15           
  Lines         814      814           
  Branches      259      259           
=======================================
  Hits          716      716           
  Misses         84       84           
  Partials       14       14

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 4b097e2...cac171b. Read the comment docs.

exports[`Client console.log hot disabled 1`] = `
Array [
"Hey.",
"[WDS] Live Reloading enabled.",
Copy link
Member Author

Choose a reason for hiding this comment

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

Should it be output this line?

Copy link
Member

Choose a reason for hiding this comment

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

Yes


exports[`Client console.log liveReload enabled 1`] = `
Array [
"Hey.",
Copy link
Member Author

Choose a reason for hiding this comment

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

We should expect [WDS] Live Reloading enabled.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, need investigate what is problem

LoganKJohnson
LoganKJohnson previously approved these changes May 20, 2019
Copy link

@LoganKJohnson LoganKJohnson left a comment

Choose a reason for hiding this comment

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

That's looks good.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Looks good, but will be great to write tests without running real browser, it is very slow test and looks like integration than unit


exports[`Client console.log liveReload enabled 1`] = `
Array [
"Hey.",
Copy link
Member

Choose a reason for hiding this comment

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

Yes, need investigate what is problem

@hiroppy
Copy link
Member Author

hiroppy commented May 23, 2019

client-src depends on browsers variables, e.g window, postMessage. So this code should be tested on browsers. I propose to divide the tests into different types as npm tasks.

@alexander-akait
Copy link
Member

@hiroppy jest support jsdom and windows and other tools avaliable, but maybe it is bad idea try to use jsdom because many features are unavailable, so i think it is ok using this approach

@alexander-akait
Copy link
Member

Anyway need investigate why some value invalid in tests as i written above

@hiroppy
Copy link
Member Author

hiroppy commented May 23, 2019

jest support jsdom and windows and other tools avaliable, but maybe it is bad idea try to use jsdom because many features are unavailable, so i think it is ok using this approach

Yeah, I agree with you.

Anyway need investigate why some value invalid in tests as i written above

I would like to investigate after merging this PR.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Don't forget to investigate why tests invalid in some cases

@hiroppy hiroppy dismissed stale reviews from alexander-akait and LoganKJohnson via aa0d9fb May 28, 2019 21:34
@hiroppy hiroppy force-pushed the feature/add-client-tests branch from cac171b to aa0d9fb Compare May 28, 2019 21:34
@hiroppy
Copy link
Member Author

hiroppy commented May 28, 2019

I just fixed lint. PTAL /cc @evilebottnawi

@hiroppy
Copy link
Member Author

hiroppy commented May 28, 2019

And I'll start to investigate client code, so I need this pr.

@alexander-akait alexander-akait merged commit bc83223 into master May 29, 2019
@alexander-akait alexander-akait deleted the feature/add-client-tests branch May 29, 2019 09:55
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.

3 participants