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

rewire workaround for NodeJS 12 #774

Merged
merged 3 commits into from
Jul 12, 2019

Conversation

breautek
Copy link
Contributor

Platforms affected

Android tests

Motivation and Context

Fixes jasmine output on NodeJS 12.
Fixes #768

Description

Rewiring the process object no longer works as of NodeJS 12. However you can still rewire members of the process object. This PR rewires individual process members as required by the test, instead of rewiring the process object entirely.

Testing

I've ran npm test and observed full jasmine output on Node 12. Note, due to another issue as reported #767 here, there is still 1 test failing on NodeJS 12.

I've also ran the tests successfully on NodeJS 10.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek changed the title rewire workaroud for NodeJS 12 rewire workaround for NodeJS 12 Jul 12, 2019
@codecov-io
Copy link

codecov-io commented Jul 12, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #774   +/-   ##
=======================================
  Coverage   66.57%   66.57%           
=======================================
  Files          18       18           
  Lines        1822     1822           
=======================================
  Hits         1213     1213           
  Misses        609      609

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 4b9e18c...823b20a. Read the comment docs.

@brodycj
Copy link
Contributor

brodycj commented Jul 12, 2019

FYI Travis CI failed on the first time Node.js 8, turned green after I restarted that job. This looks like a transient failure that is not related to this change.

Copy link
Contributor

@brodycj brodycj left a comment

Choose a reason for hiding this comment

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

@brodycj brodycj merged commit 38c6627 into apache:master Jul 12, 2019
@breautek breautek deleted the gh-768-rewire-workaround branch July 12, 2019 12:32
@brodycj
Copy link
Contributor

brodycj commented Jul 16, 2019

FYI these updates will be superseded by PR #783, which is basically a simpler solution that we think is slightly more correct.

The explanation is that using spyOn generally blocks the actual function unless .and.callThrough() is chained on. I just found a nice article here: https://hatoum.com/blog/2016/11/12/jasmine-unit-testing-dont-forget-to-callthrough

Thanks again @breautek for all of your work to help us out.

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.

Jasmine doesn't print all of its test output on Node 12
3 participants