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

feat(weex): add code coverage test #8006

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

imyzf
Copy link
Contributor

@imyzf imyzf commented Apr 12, 2018

  1. Add rollup-plugin-istanbul to instrument weex package build, this let us see the coverage of each source file rather than the built file.
  2. Add nyc package to call istanbul from cli.
  3. Add .weex.nycrc to config nyc for weex.
  4. Add npm script test:weex:cover to run the test.

Here is the result from coverage/lcov-report/index.html:
image

Emmmm... the coverage is very low now, and I'll write more test case in the next time .


What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Copy link
Contributor

@Hanks10100 Hanks10100 left a comment

Choose a reason for hiding this comment

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

I have tried this test script, it works well on my machine. Good job! However, I think it's better to put the .weex.nycrc file within the test/weex folder rather than the root path.

@imyzf
Copy link
Contributor Author

imyzf commented May 30, 2018

I have added some test case and ignore some line. Now it is:
image

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

Successfully merging this pull request may close these issues.

2 participants