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

Support for local imports with package #102

Open
jtmcdole opened this issue Jan 18, 2016 · 0 comments
Open

Support for local imports with package #102

jtmcdole opened this issue Jan 18, 2016 · 0 comments

Comments

@jtmcdole
Copy link

If the user is using package:// in their tests, coverage will not be reported because the "lib" is not appended to the path. Here's a dirty hack to get this working:

pub.bat run coverage:format_coverage --in coverage.json --package-root=/c/Users/codefu/dart/  --report-on=lib  | less

In lib/resolver.dart:

      var resolved = resolveSymbolicLinks(p.join(packageRoot, path));
      if (resolved == null && path.contains('/')) {
        // try adding lib for projects that use package:lib
        path = path.replaceFirst('/', '/lib/');
        resolved = resolveSymbolicLinks(p.join(packageRoot, path));
      }
      return resolved;

Output as expected!

      2|  ArdProto(this.port, {this.debug: false}) {
      2|    _startReading();
       |  }

If you are fine with this, I can make a pull request.

jtmcdole added a commit to jtmcdole/coverage that referenced this issue Jan 18, 2016
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

No branches or pull requests

1 participant