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

How to efficiently lower your karma

Intersecting with the x-axis / intersecting the x-axis

Series that evaluates to different values upon changing order of summation

Why did Captain America age?

Why does it take longer to fly from London to Xi'an than to Beijing

Why do Thanos' punches not kill Captain America or at least cause vital wounds?

Does the 500 feet falling cap apply per fall, or per turn?

What was the notion of limit that Newton used?

Passport stamps art, can it be done?

Is there a need for better software for writers?

My perfect evil overlord plan... or is it?

Which other programming languages apart from Python and predecessor are out there using indentation to define code blocks?

Why is PerfectForwardSecrecy considered OK, when it has same defects as salt-less password hashing?

Examples where existence is harder than evaluation

How to handle DM constantly stealing everything from sleeping characters?

Why do unstable nuclei form?

How to evaluate sum with one million summands?

What is wrong with my code? RGB potentiometer

Is every story set in the future "science fiction"?

Why is it wrong to *implement* myself a known, published, widely believed to be secure crypto algorithm?

Watching the game, having a puzzle

Two researchers want to work on the same extension to my paper. Who to help?

How to select certain lines (n, n+4, n+8, n+12...) from the file?

Pre-1993 comic in which Wolverine's claws were turned to rubber?



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;








6















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






























    6















    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


























      6












      6








      6


      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 10 hours ago









      David Reed

      41.7k82463




      41.7k82463










      asked 10 hours ago









      RodrigoRodrigo

      1128




      1128




















          1 Answer
          1






          active

          oldest

          votes


















          4














          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









            4














            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



























              4














              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

























                4












                4








                4







                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 8 hours ago









                Brian MillerBrian Miller

                1,037421




                1,037421



























                    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

                    Log på Navigationsmenu

                    Wonderful Copenhagen (sang) Eksterne henvisninger | NavigationsmenurSide på frankloesser.comWonderful Copenhagen

                    Detroit Tigers Spis treści Historia | Skład zespołu | Sukcesy | Członkowie Baseball Hall of Fame | Zastrzeżone numery | Przypisy | Menu nawigacyjneEncyclopedia of Detroit - Detroit TigersTigers Stadium, Detroit, MITigers Timeline 1900sDetroit Tigers Team History & EncyclopediaTigers Timeline 1910s1935 World Series1945 World Series1945 World Series1984 World SeriesComerica Park, Detroit, MI2006 World Series2012 World SeriesDetroit Tigers 40-Man RosterDetroit Tigers Coaching StaffTigers Hall of FamersTigers Retired Numberse