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

Add test coverage reporting #3834

Merged
merged 14 commits into from
Jul 1, 2019

Conversation

outofambit
Copy link
Contributor

@outofambit outofambit commented Jun 24, 2019

closes #3385

  • adds a third build of p5.js that includes instrumentation to measure code coverage.
  • general summary of test coverage is printed out after running tests
  • detailed html page of test coverage is generated at coverage/index.html

@outofambit outofambit added this to the 0.9.0 milestone Jun 24, 2019
} else {
if (coverage) {
await fs.mkdir('./.nyc_output/', { recursive: true });
await fs.writeFile(
Copy link
Member

Choose a reason for hiding this comment

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

Any errors in these will not be caught properly and might be problematic - I would probably consider doing something like

          const { stats, coverage }  = await new Promise(resolve => eventHandler1.on('mocha:end', resolve));
          if (stats.failures) {
            throw new Error(stats);
          }
          if (coverage) {
            await fs.mkdir('./.nyc_output/', { recursive: true });
            await fs.writeFile(
              './.nyc_output/out.json',
              JSON.stringify(coverage)
            );
          }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how does this look now? i tried the above but had some issues so i tried to find something between that and the current structure.

@outofambit outofambit marked this pull request as ready for review July 1, 2019 05:16
@lmccart lmccart merged commit 9bf4233 into processing:master Jul 1, 2019
@outofambit outofambit deleted the add-test-coverage-reporting branch July 1, 2019 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Measure Unit Test Coverage
3 participants