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

Fix to output relative path correctly #70

Merged
merged 1 commit into from Dec 24, 2018

Conversation

mtsmfm
Copy link
Contributor

@mtsmfm mtsmfm commented Dec 18, 2018

Currently filepath starts with / but in most case, it's a wrong path.

How to reproduce

git clone https://github.com/jest-community/jest-junit
cd jest-junit
yarn install
JEST_JUNIT_SUITE_NAME='{filepath}' yarn jest --env node integration-tests/reporter/__tests__/simple.test.js --reporters=default --reporters=$PWD/index.js

Before

<testsuites name="jest tests" tests="1" failures="0" time="0.336">
  <testsuite name="/integration-tests/reporter/__tests__/simple.test.js" errors="0" failures="0" skipped="0" timestamp="2018-12-18T10:54:15" time="0.216" tests="1">
    <testcase classname="foo should pass" name="foo should pass" time="0.003">
    </testcase>
  </testsuite>
</testsuites>

After

<testsuites name="jest tests" tests="1" failures="0" time="0.364">
  <testsuite name="integration-tests/reporter/__tests__/simple.test.js" errors="0" failures="0" skipped="0" timestamp="2018-12-18T10:55:11" time="0.241" tests="1">
    <testcase classname="foo should pass" name="foo should pass" time="0.003">
    </testcase>
  </testsuite>
</testsuites>

@mtsmfm
Copy link
Contributor Author

mtsmfm commented Dec 22, 2018

@palmerj3 Can I ask you to review?

@palmerj3
Copy link
Collaborator

@mtsmfm the change itself looks good and thanks for taking the time to contribute!

Before I merge could you please just provide a rationale for this change? What problem(s) is it solving on your end?

Thanks!

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.

None yet

2 participants