<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Olavo Parno</title>
    <description>The latest articles on DEV Community by Olavo Parno (@olavoparno).</description>
    <link>https://dev.to/olavoparno</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F340414%2Ff6e76e8f-9a8b-46aa-9694-d6b1b0ea9bd3.png</url>
      <title>DEV Community: Olavo Parno</title>
      <link>https://dev.to/olavoparno</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/olavoparno"/>
    <language>en</language>
    <item>
      <title>Create README test coverage badges from istanbul reports</title>
      <dc:creator>Olavo Parno</dc:creator>
      <pubDate>Fri, 18 Sep 2020 17:51:34 +0000</pubDate>
      <link>https://dev.to/olavoparno/create-readme-test-coverage-badges-from-istanbul-reports-14m</link>
      <guid>https://dev.to/olavoparno/create-readme-test-coverage-badges-from-istanbul-reports-14m</guid>
      <description>&lt;h3&gt;
  
  
  There are fantastic tools for coverage badges such as &lt;a href="https://coveralls.io/"&gt;Coveralls&lt;/a&gt; but, for &lt;strong&gt;free&lt;/strong&gt;, they only cover &lt;strong&gt;public&lt;/strong&gt; repositories
&lt;/h3&gt;

&lt;h3&gt;
  
  
  What then if a repository is &lt;strong&gt;private&lt;/strong&gt;? Bind it to a process run locally with &lt;a href="https://github.com/olavoparno/istanbul-badges-readme"&gt;&lt;strong&gt;Istanbul Readme Badges&lt;/strong&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hCL7blhR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2vavlvz8rtcw0a0z2x5a.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hCL7blhR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2vavlvz8rtcw0a0z2x5a.gif" alt="Process"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  One can follow the very &lt;a href="https://github.com/olavoparno/istanbul-badges-readme#readme"&gt;README.md&lt;/a&gt; of the project but in short here is what is needed:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install it
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i &lt;span class="nt"&gt;-D&lt;/span&gt; istanbul-badges-readme
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;A &lt;em&gt;README.md&lt;/em&gt; file with additional &lt;a href="https://github.com/olavoparno/istanbul-badges-readme#example-markup-paste-it-anywhere-in-your-readmemd"&gt;markup&lt;/a&gt; into which the badges are inserted
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight markdown"&gt;&lt;code&gt;| Statements                | Branches                | Functions                | Lines                |
| ------------------------- | ----------------------- | ------------------------ | -------------------- |
| !&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Statements&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#branches#&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; | !&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Branches&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#branches#&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; | !&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Functions&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#branches#&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; | !&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Lines&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#branches#&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; |
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the script anywhere, either in a, e.g. &lt;code&gt;pre-commit&lt;/code&gt; &lt;a href="https://github.com/typicode/husky"&gt;husky hook&lt;/a&gt;, or in a pure NPM script directly
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;node_modules/.bin/istanbul-badges-readme
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Voilà&lt;/em&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1EeQZAu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zegw541c78ydd30jex46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1EeQZAu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zegw541c78ydd30jex46.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>coverage</category>
      <category>badges</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Run Google's Lighthouse under authenticated websites</title>
      <dc:creator>Olavo Parno</dc:creator>
      <pubDate>Thu, 17 Sep 2020 13:34:56 +0000</pubDate>
      <link>https://dev.to/olavoparno/run-google-s-lighthouse-under-authenticated-websites-25ol</link>
      <guid>https://dev.to/olavoparno/run-google-s-lighthouse-under-authenticated-websites-25ol</guid>
      <description>&lt;h3&gt;
  
  
  Have you ever run into a situation where your website demands some performance tweaks so you think of Google's Lighthouse and faces this problem:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnxoou4v01pr8stuo20il.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnxoou4v01pr8stuo20il.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Fear not, my friend, for there are multiple solutions for this. See the links below for more info:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/GoogleChrome/lighthouse#using-the-node-cli" rel="noopener noreferrer"&gt;Lighthouse CLI Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/GoogleChrome/lighthouse/blob/master/docs/authenticated-pages.md" rel="noopener noreferrer"&gt;Lighthouse CLI Auth Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  In this article I am covering the &lt;strong&gt;Option 4&lt;/strong&gt; from the Auth Docs: &lt;em&gt;Open a debug instance of Chrome and manually log in&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3vioam6nm5cp3dm1i2e0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3vioam6nm5cp3dm1i2e0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Personal Notes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The application must be served either on a server or locally e.g.: &lt;a href="http://mysite.com" rel="noopener noreferrer"&gt;http://mysite.com&lt;/a&gt; or &lt;a href="http://localhost:port" rel="noopener noreferrer"&gt;http://localhost:port&lt;/a&gt; (seems obvious, doesn't it?)&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;chrome-debug&lt;/code&gt; so that the debugging browser is opened and the debugging port is shown&lt;/li&gt;
&lt;li&gt;If the opened window closes before being able to login, use the &lt;code&gt;--max-wait-for-load 15000&lt;/code&gt; for 15 seconds or so (time in milliseconds)&lt;/li&gt;
&lt;li&gt;Say the application is behind SSL certificates, auto-signed ones, and there is a need to accept the risk everytime one runs it, bypass it by using the &lt;code&gt;--chrome-flags="--ignore-certificate-errors"&lt;/code&gt; flag&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are a bunch of other flags listed here &lt;a href="https://github.com/GoogleChrome/lighthouse#cli-options" rel="noopener noreferrer"&gt;Lighthouse CLI Flags&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Final command with the beforementioned flags:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lighthouse http://localhost:3000 &lt;span class="nt"&gt;--disable-storage-reset&lt;/span&gt; &lt;span class="nt"&gt;--chrome-flags&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"--ignore-certificate-errors"&lt;/span&gt; &lt;span class="nt"&gt;--max-wait-for-load&lt;/span&gt; 15000 &lt;span class="nt"&gt;--port&lt;/span&gt; 45457
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Thats it, a short and direct approach. There are multiple ways described in their docs but this is the most straighforward I could find.
&lt;/h3&gt;

</description>
      <category>javascript</category>
      <category>webperf</category>
      <category>webdev</category>
      <category>lighthouse</category>
    </item>
  </channel>
</rss>
