Visual representation code coverage in VSCodeHow do I get Apex code coverage statistics when using Salesforce DX & Visual Studio CodeApex Code Coverage: Test classes are included with 0% in overall code coverage calculationCode Coverage QueryCode Coverage - SalesForce BugNeed help raising Code Coveragecode coverage none whereas percentage availableCode Coverage Report SchedulerCode Coverage Calculation - Seems to be including code in test methodsHow to fix unneeded Code Coverage?vscode/sfdx doesn't see my projectNo code coverage information was found for test run 7070U00000r8Ny3. Set “salesforcedx-vscode-core.retrieve-test-code-coverage”: true

Single word that parallels "Recent" when discussing the near future

Why did the soldiers of the North disobey Jon?

Could there be a material that inverts the colours seen through it?

A case where Bishop for knight isn't a good trade

complicated arrows in flowcharts

Is it safe to use two single-pole breakers for a 240v circuit?

Can a tourist shoot a gun for recreational purpose in the USA?

"The van's really booking"

Biology of a Firestarter

Polynomial division: Is this trick obvious?

Holding rent money for my friend which amounts to over $10k?

What information exactly does an instruction cache store?

Why doesn't Iron Man's action affect this person in Endgame?

Help understanding this line - usage of くれる

Were any of the books mentioned in this scene from the movie Hackers real?

Is 12 minutes connection in Bristol Temple Meads long enough?

Use of さ as a filler

Is there any way to adjust the damage type of the Eldritch Blast cantrip so that it does fire damage?

Adding labels and comments to a matrix

Source of the Wildfire?

Is Valonqar prophecy unfulfilled?

Offered a new position but unknown about salary?

Mark command as obsolete

How to continually let my readers know what time it is in my story, in an organic way?



Visual representation code coverage in VSCode


How do I get Apex code coverage statistics when using Salesforce DX & Visual Studio CodeApex Code Coverage: Test classes are included with 0% in overall code coverage calculationCode Coverage QueryCode Coverage - SalesForce BugNeed help raising Code Coveragecode coverage none whereas percentage availableCode Coverage Report SchedulerCode Coverage Calculation - Seems to be including code in test methodsHow to fix unneeded Code Coverage?vscode/sfdx doesn't see my projectNo code coverage information was found for test run 7070U00000r8Ny3. Set “salesforcedx-vscode-core.retrieve-test-code-coverage”: true






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








7















As per answer in this post, in order to get code coverage after running test classes from VSCode, we just need to add "-c" for the sfdx test command as below:



 sfdx force:apex:test:run -c -u myOrg -r human


I have added




salesforcedx-vscode-core.retrieve-test-code-coverage": true




to my User Settings to be set as default.



Even though I can get the code coverage in the Output tab, showing the percentage + uncovered lines numbers, I haven't been able to see a visual representation for each class which lines have been hit or not.



This is what we get after running the tests:



 ID NAME % COVERED UNCOVERED LINES
────────────────── ─────────────────────────────────── ────────────────── ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
01p0d000000kCOcAAM TaskManager 75% 66,67,72,74,75,78,79,82,86,87,89,93,97,100,102,105,106,111,114,119,120,123,125,128,129,130,134,135,140,143,144,145,148,193,243,246,248,251,253,257,260,262,265,267,271,274,276,421,461,474,486


Does anybody know is it's possible to get code coverage like we get in Developer Console or like the "coverage-gutters" plugin for VSCode, after running Apex Tests?



enter image description here



Thanks.










share|improve this question






























    7















    As per answer in this post, in order to get code coverage after running test classes from VSCode, we just need to add "-c" for the sfdx test command as below:



     sfdx force:apex:test:run -c -u myOrg -r human


    I have added




    salesforcedx-vscode-core.retrieve-test-code-coverage": true




    to my User Settings to be set as default.



    Even though I can get the code coverage in the Output tab, showing the percentage + uncovered lines numbers, I haven't been able to see a visual representation for each class which lines have been hit or not.



    This is what we get after running the tests:



     ID NAME % COVERED UNCOVERED LINES
    ────────────────── ─────────────────────────────────── ────────────────── ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    01p0d000000kCOcAAM TaskManager 75% 66,67,72,74,75,78,79,82,86,87,89,93,97,100,102,105,106,111,114,119,120,123,125,128,129,130,134,135,140,143,144,145,148,193,243,246,248,251,253,257,260,262,265,267,271,274,276,421,461,474,486


    Does anybody know is it's possible to get code coverage like we get in Developer Console or like the "coverage-gutters" plugin for VSCode, after running Apex Tests?



    enter image description here



    Thanks.










    share|improve this question


























      7












      7








      7


      1






      As per answer in this post, in order to get code coverage after running test classes from VSCode, we just need to add "-c" for the sfdx test command as below:



       sfdx force:apex:test:run -c -u myOrg -r human


      I have added




      salesforcedx-vscode-core.retrieve-test-code-coverage": true




      to my User Settings to be set as default.



      Even though I can get the code coverage in the Output tab, showing the percentage + uncovered lines numbers, I haven't been able to see a visual representation for each class which lines have been hit or not.



      This is what we get after running the tests:



       ID NAME % COVERED UNCOVERED LINES
      ────────────────── ─────────────────────────────────── ────────────────── ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      01p0d000000kCOcAAM TaskManager 75% 66,67,72,74,75,78,79,82,86,87,89,93,97,100,102,105,106,111,114,119,120,123,125,128,129,130,134,135,140,143,144,145,148,193,243,246,248,251,253,257,260,262,265,267,271,274,276,421,461,474,486


      Does anybody know is it's possible to get code coverage like we get in Developer Console or like the "coverage-gutters" plugin for VSCode, after running Apex Tests?



      enter image description here



      Thanks.










      share|improve this question
















      As per answer in this post, in order to get code coverage after running test classes from VSCode, we just need to add "-c" for the sfdx test command as below:



       sfdx force:apex:test:run -c -u myOrg -r human


      I have added




      salesforcedx-vscode-core.retrieve-test-code-coverage": true




      to my User Settings to be set as default.



      Even though I can get the code coverage in the Output tab, showing the percentage + uncovered lines numbers, I haven't been able to see a visual representation for each class which lines have been hit or not.



      This is what we get after running the tests:



       ID NAME % COVERED UNCOVERED LINES
      ────────────────── ─────────────────────────────────── ────────────────── ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      01p0d000000kCOcAAM TaskManager 75% 66,67,72,74,75,78,79,82,86,87,89,93,97,100,102,105,106,111,114,119,120,123,125,128,129,130,134,135,140,143,144,145,148,193,243,246,248,251,253,257,260,262,265,267,271,274,276,421,461,474,486


      Does anybody know is it's possible to get code coverage like we get in Developer Console or like the "coverage-gutters" plugin for VSCode, after running Apex Tests?



      enter image description here



      Thanks.







      apex code-coverage vs-code






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 9 at 14:48









      David Reed

      42k82463




      42k82463










      asked May 9 at 14:47









      RodrigoRodrigo

      1178




      1178




















          1 Answer
          1






          active

          oldest

          votes


















          5














          In VS Code in your DX project, try clicking the three horizontal lines icon in the bottom status bar. If you have all the configurations setup correctly (which from your post, it looks like you do), clicking it from enter image description here to enter image description here should work






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "459"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f261788%2fvisual-representation-code-coverage-in-vscode%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            5














            In VS Code in your DX project, try clicking the three horizontal lines icon in the bottom status bar. If you have all the configurations setup correctly (which from your post, it looks like you do), clicking it from enter image description here to enter image description here should work






            share|improve this answer



























              5














              In VS Code in your DX project, try clicking the three horizontal lines icon in the bottom status bar. If you have all the configurations setup correctly (which from your post, it looks like you do), clicking it from enter image description here to enter image description here should work






              share|improve this answer

























                5












                5








                5







                In VS Code in your DX project, try clicking the three horizontal lines icon in the bottom status bar. If you have all the configurations setup correctly (which from your post, it looks like you do), clicking it from enter image description here to enter image description here should work






                share|improve this answer













                In VS Code in your DX project, try clicking the three horizontal lines icon in the bottom status bar. If you have all the configurations setup correctly (which from your post, it looks like you do), clicking it from enter image description here to enter image description here should work







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 9 at 16:25









                Brian MillerBrian Miller

                1,112421




                1,112421



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Salesforce Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f261788%2fvisual-representation-code-coverage-in-vscode%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form