title: Publishing Nx Monorepo Test Results in Azure CI Pipeline
date: '2021-01-30 00:00 +0000'
subtitle: Learn writing Azure CI pipeline to show Nx Monorepo combined Test Results
description: Learn writing Azure CI pipeline to show Nx Monorepo combined Test Results
# Publishing Nx Monorepo Test Results in Azure CI Pipeline
`Publish Test Results task` publishes test results to Azure CI Pipelines.
## Step 1: Publish Unit Test Summary Report
Step 1 - To generate Test Report I’m using Karma JUnit Reporter. First install it to your project.
`npm i karma-junit-reporter -D`
Step 2 — Now we have to import above ‘karma-junit-reporter’ in to our project and have to configure. So for that, open ‘karma.conf.js’ file in your project. There, in the ‘plugins’ section, add the following line.
Step 3 — Now we have to say use this ‘karma-junit-reporter’ to generate Test Report. For that, in ‘karma.conf.js’ file, you can see a section ‘reporter’. Add the following inside the array.
Step 4 — okay. Now we have said to use JUnit repoter service to generate our Test Report. But to where ? We have to say, where to publish the Test Report. For that, add the following Code Snippet, before the ‘reporters’ section.
Step 5- In the Azure DevOps Build Pipeline. ‘Publish Test Results’. Click on + symbol and search ‘Publish Test Results’. Add it.
Add below task in your azure-pipelines.yml file. You can skip the `condition`. I needed that for my Nx Monorepo project. You can just have task and inputs only.
Azure devops task supports merging multiple test results files out of the box. For that we will use `mergeTestResults: true` flag.
# Publish Test Results
# Publish Test Results
- task: PublishTestResults@2
## Test results files created
When you run test now you should see test results file.
In order to avoid check-in them in git repo consider updating `.gitignore`
# Test Results
## Running Build in Azure Pipeline
## Do You Want to become full stack developer? :computer:
If you want to become full stack developer and grow your carrier as Lead Developer/Architect. Consider subscribing to our full stack development training programs. We have monthly membership plans and you will get unlimited access to all of our video courses, slides, source code & Monthly video calls.
- Please visit www.fullstackmaster.net/pro to subscribe to All Access PRO membership.
- Please visit www.fullstackmaster.net/elite to subscribe to All Access ELITE membership. You will get everything from PRO plan. Additionally you will get access to monthly live Q&A video call with Rupesh and ask doubts and get more tips and tricks.
>You bright future is waiting for you so visit today www.fullstackmaster.net and allow me to help you to board on your dream software architect/lead role.
### :sparkling_heart: Contact Details: Say :wave: to me!
* Rupesh Tiwari
* :email: <firstname.lastname@example.org>
* Founder of www.fullstackmaster.net :mortar_board:
* [<img src="https://i.imgur.com/9OCLciM.png" width="295" height="65">](http://www.fullstackmaster.net)