Can I add jest code coverage to Reports in Bitbucket Pull Requests from Pipelines Can I add jest code coverage to Reports in Bitbucket Pull Requests from Pipelines curl curl

Can I add jest code coverage to Reports in Bitbucket Pull Requests from Pipelines


Jest code coverage reports are different format, you need to convert them into this format:

{  "files": [    {      "path": "backend/src/app.ts",      "coverage": "C:51,52;P:53;U:54,55"    }  ]}

The API endpoint you are using also doesn't seem right. It should be a POST request as mentioned in the plugin docs:

https://bitbucket.org/atlassian/bitbucket-code-coverage/src/master/code-coverage-plugin/README.md


Hey please kindly use this pipeline

clone:  depth: fulldefinitions:  caches:    sonar: ~/.sonar/cache  # Caching SonarCloud artifacts will speed up your build  steps:    - step: &sonarcloud        name: Build, test and analyze on SonarCloud        caches:          - node          - sonar        script:          - pipe: sonarsource/sonarcloud-scan:1.2.0            variables:              SONAR_TOKEN: ${SONAR_TOKEN}              EXTRA_ARGS: '-Dsonar.source=src -Dsonar.exclusions=android/**/*,ios/**,node_modules/** -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info'pipelines:  pull-requests:    '**':      - step:          image: node:10.15.0          caches:            - node          script:            - npm install -g yarn            - yarn install            - npm run lint            - npm run test          artifacts:            - coverage/**      - step: *sonarcloud  branches:    master:      - step:          image: node:10.15.0          size: 2x          caches:            - node          script:            - npm install -g yarn            - yarn install && npx jetify            - npm run lint            - npm run test          artifacts:            - coverage/**      - step: *sonarcloud      - step:          image: piotrovskyi/react-native-fastlane          caches:            - node          size: 2x          script:            - git remote set-url origin $BITBUCKET_GIT_SSH_ORIGIN            - npm install -g yarn            - yarn install && npx jetify            - bundle install            - npm run bump-patch            - bundle exec fastlane android _tag    staging:      - step:          image: node:10.15.0          caches:            - node          script:            - npm install -g yarn            - yarn install && npx jetify            - npm run lint            - npm run test          artifacts:            - coverage/**      - step: *sonarcloud      - step:          image: piotrovskyi/react-native-fastlane          caches:            - node          size: 2x          script:            - git remote set-url origin $BITBUCKET_GIT_SSH_ORIGIN            - npm install -g yarn            - yarn install && npx jetify            - bundle install            - npm run bump-patch            - bundle exec fastlane android generate_apk_prerelease            - bundle exec fastlane android upload_apk_appcenter_staging token:$APPCENTER_RELEASE_STAGING slackUrl:$SLACK            - bundle exec fastlane android upload_apk_appcenter_sandbox token:$APPCENTER_RELEASE_SANDBOX slackUrl:$SLACK    sandbox:      - step:          image: node:10.15.0          caches:            - node          script:            - npm install -g yarn            - yarn install && npx jetify            - npm run lint            - npm run test          artifacts:            - coverage/**      - step: *sonarcloud      - step:          image: piotrovskyi/react-native-fastlane          caches:            - node          size: 2x          script:            - git remote set-url origin $BITBUCKET_GIT_SSH_ORIGIN            - npm install -g yarn            - yarn install && npx jetify            - bundle install            - npm run bump-patch            - bundle exec fastlane android generate_apk_prerelease            - bundle exec fastlane android upload_apk_appcenter_staging token:$APPCENTER_RELEASE_STAGING slackUrl:$SLACK            - bundle exec fastlane android upload_apk_appcenter_sandbox token:$APPCENTER_RELEASE_SANDBOX slackUrl:$SLACK