<?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: Pankaj Dalvi</title>
    <description>The latest articles on DEV Community by Pankaj Dalvi (@_pdalvi).</description>
    <link>https://dev.to/_pdalvi</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%2F1207194%2F73570b6f-6e18-41ec-ae48-a0995dde5094.png</url>
      <title>DEV Community: Pankaj Dalvi</title>
      <link>https://dev.to/_pdalvi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_pdalvi"/>
    <language>en</language>
    <item>
      <title>Setting up autoscaling apache Kafka cluster on kinD.</title>
      <dc:creator>Pankaj Dalvi</dc:creator>
      <pubDate>Sun, 11 Jan 2026 09:45:25 +0000</pubDate>
      <link>https://dev.to/_pdalvi/setting-up-autoscaling-apache-kafka-cluster-on-kind-4jj6</link>
      <guid>https://dev.to/_pdalvi/setting-up-autoscaling-apache-kafka-cluster-on-kind-4jj6</guid>
      <description>&lt;p&gt;Recently I was looking for a good article to setup apache kafka cluster on kubernetes with an autoscaling feature, based on the lag metrics of the messages received with a node js express application.&lt;/p&gt;

&lt;p&gt;There were not many good resources around which were using kafka confluent image with zookeeper. Here is a github code &lt;a href="https://github.com/pdalvi1893/kafka" rel="noopener noreferrer"&gt;link&lt;/a&gt;, along with the necessary  configuration files for kubernetes and node js application. &lt;/p&gt;

</description>
      <category>kind</category>
      <category>kubernetes</category>
      <category>kafka</category>
      <category>express</category>
    </item>
    <item>
      <title>Unit testing in Strapi</title>
      <dc:creator>Pankaj Dalvi</dc:creator>
      <pubDate>Fri, 31 May 2024 17:32:53 +0000</pubDate>
      <link>https://dev.to/_pdalvi/unit-testing-in-strapi-46o1</link>
      <guid>https://dev.to/_pdalvi/unit-testing-in-strapi-46o1</guid>
      <description>&lt;p&gt;Strapi has been there around for quite some time now with a lot of organisations using it as their go to production framework for building cool apps using React , angular etc.&lt;/p&gt;

&lt;p&gt;However the more you search but less you find is about unit testing in strapi. There are lot of blogs that are termed as Unit testing in strapi however they are technically doing end to end testing using a sqlite database making reals hit to apis and generating a real output.&lt;/p&gt;

&lt;p&gt;The goal of this blog post is to shed some light on building unit tests for strapi, testing custom controller methods and services using unit tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting started
&lt;/h3&gt;

&lt;p&gt;First and foremost create a sample strapi project. Below is the link for the same.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.strapi.io/dev-docs/quick-start" rel="noopener noreferrer"&gt;Strapi Docs&lt;/a&gt; - Strapi Getting Started Documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Install Dependencies
&lt;/h3&gt;

&lt;p&gt;Run the below command to install jest dependency&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install jest supertest  --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Set-up Run comand
&lt;/h3&gt;

&lt;p&gt;Add the below command in package.json file. You may tweak the start command SET NODE_ENV==test based on your OS. This command is specific to windows environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"SET NODE_ENV==test &amp;amp; jest --runInBand --detectOpenHandles --testPathPattern=unit-tests/"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create Custom Controller Method
&lt;/h3&gt;

&lt;p&gt;Add the below command in package.json file. You may tweak the start command SET NODE_ENV==test based on your OS. This command is specific to windows environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Custom Service Method
&lt;/h3&gt;

&lt;p&gt;Add the below command in package.json file. You may tweak the start command SET NODE_ENV==test based on your OS. This command is specific to windows environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Strapi Unit Tests For Controller
&lt;/h3&gt;

&lt;p&gt;Add the below command in package.json file. You may tweak the start command SET NODE_ENV==test based on your OS. This command is specific to windows environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Strapi Unit tests For Services
&lt;/h3&gt;

&lt;p&gt;Add the below command in package.json file. You may tweak the start command SET NODE_ENV==test based on your OS. This command is specific to windows environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run Unit Tests
&lt;/h3&gt;

&lt;p&gt;Add the below command in package.json file. You may tweak the start command SET NODE_ENV==test based on your OS. This command is specific to windows environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Github Repository
&lt;/h3&gt;

&lt;p&gt;First and foremost create a sample strapi project. Below is the link for the same.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.strapi.io/dev-docs/quick-start" rel="noopener noreferrer"&gt;Strapi Docs&lt;/a&gt; - Strapi Getting Started Documentation.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>unittest</category>
      <category>jest</category>
      <category>strapi</category>
    </item>
  </channel>
</rss>
