<?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: Jia Hua Zou</title>
    <description>The latest articles on DEV Community by Jia Hua Zou (@jiahuazou).</description>
    <link>https://dev.to/jiahuazou</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%2F701203%2Ff33e7f86-b079-4f56-8d9c-fced85ad845f.png</url>
      <title>DEV Community: Jia Hua Zou</title>
      <link>https://dev.to/jiahuazou</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jiahuazou"/>
    <language>en</language>
    <item>
      <title>Telescope 3.0 (soon)!</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Fri, 22 Apr 2022 00:18:08 +0000</pubDate>
      <link>https://dev.to/jiahuazou/telescope-30-soon-4489</link>
      <guid>https://dev.to/jiahuazou/telescope-30-soon-4489</guid>
      <description>&lt;p&gt;The release of 3.0 is tomorrow!! This project has come a long way. There are lots of new technologies implemented in a 14 week period. I had learn a lot and I am very glad to have this unique experience with other students(and contributor).&lt;/p&gt;

&lt;p&gt;I haven't been posting due to my other workload from my other courses. Now that it is done I can focus my attention to Telescope. Since there isn't much time before the 3.0, I will be helping out other people's issue by either trying to help them or review on their PRs. Other than that there isn't much to say.&lt;/p&gt;

&lt;p&gt;I want to say thank you &lt;a href="https://github.com/humphd"&gt;David&lt;/a&gt; for teaching this course (His other courses are 😫 👌 💯 🔥) and the team members that are with me till now. This was a very unique course and I'm glad it was not a regret. I am planning to continue to contribute to Telescope after this semester.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Goals for Telescope</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Thu, 17 Mar 2022 21:14:03 +0000</pubDate>
      <link>https://dev.to/jiahuazou/goals-for-telescope-20b3</link>
      <guid>https://dev.to/jiahuazou/goals-for-telescope-20b3</guid>
      <description>&lt;p&gt;We only have 2 more releases left till 3.0 and we need to focus on what we need to to be shipped before then.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which part of Telescope 3.0 do I own?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I've had worked on creating different tests where &lt;code&gt;jest&lt;/code&gt; did not touch on.&lt;/li&gt;
&lt;li&gt;I've worked on the eslint configuration. There are some work left to do and I want to get it done by this week.&lt;/li&gt;
&lt;li&gt;I will also focus on getting the search service.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who can I depend on if I need help?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I can depend on everyone on the team. It is better than to rely on one or two people. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What are the risks that I see, which could prevent me from getting this shipped?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Other than the time, a possible thing that might be preventing me from shipping could be the e2e test not working properly.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>More Tests (e2e)</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Mon, 14 Mar 2022 15:13:38 +0000</pubDate>
      <link>https://dev.to/jiahuazou/more-tests-e2e-124o</link>
      <guid>https://dev.to/jiahuazou/more-tests-e2e-124o</guid>
      <description>&lt;p&gt;This week it was very busy week for me. All those midterm took most of my time. This blog will be short. This time I had to create a E2E(end-2-end) test for the signup function, but I ran into some problems. The test is to test if the function can throw a 409 status code if a user creates an account with an invalid or an already existing feed. &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2901/files#diff-6c0acb684bf6dc50333f3aae0c5e578ed885ede749bd0b13505ce721b7fbe18bR130-R131"&gt;Pr to the code&lt;/a&gt; It took sometime to understand how the code is ran because what I have should done was to read the PR instead of looking at the codes first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;First thing I did was to understand the code. I look through the &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2901"&gt;Pr&lt;/a&gt;. I follow the instruction for the steps to signing up. It was fine until I created the 2nd account. When I got to the confirm page I was expecting an error 409 in the console, but it somehow manage to create the account with the same feed. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Search test pt.2</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Mon, 21 Feb 2022 22:52:46 +0000</pubDate>
      <link>https://dev.to/jiahuazou/search-test-pt2-2aoh</link>
      <guid>https://dev.to/jiahuazou/search-test-pt2-2aoh</guid>
      <description>&lt;p&gt;If you haven't read my part 1, &lt;a href="https://dev.to/jiahuazou/search-test-pt1-3m27"&gt;Link here&lt;/a&gt;. TLDR, it's all about the connection to a mock Elasticsearch and the problems I faced.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tests
&lt;/h2&gt;

&lt;p&gt;This time it's all about the testing that I have created (&lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2927"&gt;Github PR&lt;/a&gt;). So creating the test was very easy once I got the mock connection working. My focus for these are makin sure query are sending the proper text and receiving proper data. The first setup I did was to create the &lt;code&gt;describe&lt;/code&gt; for the normal search and then I put in all of the individual tests with &lt;code&gt;it&lt;/code&gt; function like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/query routers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;return error 400 if no params given&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This first test was create before(&lt;a href="https://dev.to/jiahuazou/prerelease-26-2imh"&gt;Link to blog&lt;/a&gt;) when I setup the initial testing. Before adding different test, I have to make sure the mock has to be clear before each tests. To do that, jest has a function that can easy perform this like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;afterEach&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clearAll&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Testing for Statuscode
&lt;/h3&gt;

&lt;p&gt;After that, my first few test will be related to anything with the status code &lt;code&gt;400&lt;/code&gt; or &lt;code&gt;503&lt;/code&gt;. To cause the status code &lt;code&gt;400&lt;/code&gt;, the query send will have mistakes. So the query &lt;code&gt;filter&lt;/code&gt; has to be either &lt;code&gt;post&lt;/code&gt; or &lt;code&gt;author&lt;/code&gt; anything else will cause a status &lt;code&gt;400&lt;/code&gt;. Also if the &lt;code&gt;text&lt;/code&gt; query is empty it will also return the same error. &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2927/commits/a197decade6692242fbe1d9bda8abae17e3e4e56#diff-eca368c10a5833d8ee7d7898c68facc74568ca76a10b8ddee439a74f287c2ac1R35-R74"&gt;code block&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;returns&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;
 &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//proper return&lt;/span&gt;
&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;results&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;hits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;hits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
          &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;};&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your wondering why I have it return nothing and not return with a proper format(returning &lt;code&gt;results&lt;/code&gt; and &lt;code&gt;hits&lt;/code&gt;), it because the query isn't proper sent correctly, the result values will nothing but an error. &lt;/p&gt;

&lt;p&gt;If the query was sent correctly, and it returns not a proper format it will cause a error &lt;code&gt;503&lt;/code&gt; because the search results is expecting a &lt;code&gt;results&lt;/code&gt; and &lt;code&gt;hits&lt;/code&gt;.&lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2927/commits/a197decade6692242fbe1d9bda8abae17e3e4e56#diff-eca368c10a5833d8ee7d7898c68facc74568ca76a10b8ddee439a74f287c2ac1R165-R178"&gt;Error 503 test&lt;/a&gt;. &lt;a href="https://github.com/Seneca-CDOT/telescope/blob/master/src/api/search/src/search.js#L75-L78"&gt;request format&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing for results
&lt;/h3&gt;

&lt;p&gt;After testing the error &lt;code&gt;400&lt;/code&gt; and &lt;code&gt;503&lt;/code&gt; now I can start testing for results. There are only 2 tests, one for &lt;code&gt;post&lt;/code&gt; and the other for &lt;code&gt;author&lt;/code&gt;. &lt;a href="https://github.com/Seneca-CDOT/telescope/pull/2927/commits/a197decade6692242fbe1d9bda8abae17e3e4e56#diff-eca368c10a5833d8ee7d7898c68facc74568ca76a10b8ddee439a74f287c2ac1R97-R163"&gt;Tests for them&lt;/a&gt;. So for these tests, I made sure that I can expect a status code &lt;code&gt;200&lt;/code&gt; with results and total number of results.&lt;br&gt;
This part was a little tricky because if any of the format is wrong, it will cause a status code &lt;code&gt;503&lt;/code&gt;. The return must have a &lt;code&gt;results&lt;/code&gt; with a &lt;code&gt;hits&lt;/code&gt;. Within that &lt;code&gt;hits&lt;/code&gt; it will display the &lt;code&gt;total&lt;/code&gt; result values with a list of &lt;code&gt;url&lt;/code&gt; link with the &lt;code&gt;id&lt;/code&gt;. This is the format that it needs to return.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;results&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;hits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;hits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1234&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;POSTS_URL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;5678&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;POSTS_URL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
          &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Tackling this issue felt it was hard and easy. Mostly the mock Elasticsearch connection was the most challenging for me. It did felt very rewarding when I was able to merge my work to the repo. After this I felt like I can do more issues related to &lt;code&gt;Elasticsearch&lt;/code&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Search test pt.1</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Mon, 14 Feb 2022 18:56:54 +0000</pubDate>
      <link>https://dev.to/jiahuazou/search-test-pt1-3m27</link>
      <guid>https://dev.to/jiahuazou/search-test-pt1-3m27</guid>
      <description>&lt;p&gt;It took longer than I expect, but I manage to get it to work with the help from &lt;a href="https://github.com/rclee91"&gt;Roxanne&lt;/a&gt;. There was a lot meetings and keeping each other up to date on our progression. I have learned a lot in the past few weeks.&lt;/p&gt;

&lt;h2&gt;
  
  
  setup
&lt;/h2&gt;

&lt;p&gt;If you haven't read my last post. It was about how to create the initial setup. &lt;a href="https://dev.to/jiahuazou/prerelease-26-2imh"&gt;Link&lt;/a&gt;. TLDR. We needed to create the jest &lt;code&gt;setup&lt;/code&gt; and the &lt;code&gt;config&lt;/code&gt; file. After that we create the &lt;code&gt;test&lt;/code&gt; file. This will contain all of the different tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mock Elastic search connection
&lt;/h2&gt;

&lt;p&gt;I was stuck on this part for the longest time.&lt;/p&gt;

&lt;h4&gt;
  
  
  Problems
&lt;/h4&gt;

&lt;p&gt;First thing I did was, I read the Elastic search mock [blog}(&lt;a href="https://www.elastic.co/blog/smooth-mocking-with-the-elasticsearch-node-js-client"&gt;https://www.elastic.co/blog/smooth-mocking-with-the-elasticsearch-node-js-client&lt;/a&gt;). It has a lot of information. First thing I try was I use the &lt;code&gt;client&lt;/code&gt; and the &lt;code&gt;mock&lt;/code&gt; from the &lt;code&gt;Elasticsearch&lt;/code&gt; library. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@elastic/elasticsearch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Mock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@elastic/elasticsearch-mock&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Mock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; 
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; 
  &lt;span class="na"&gt;node&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:9200&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;Connection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getConnection&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; 
&lt;span class="p"&gt;})&lt;/span&gt; 
&lt;span class="nx"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; 
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; 
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ok&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have pass the &lt;code&gt;mock.getConnection()&lt;/code&gt; to the &lt;code&gt;Connection&lt;/code&gt; for client. From this, all of the connection is going through the mock Elasticsearch instead of the real Elasticsearch. Then I add a mock. It requires the method and paths and returns a status. After ward I use the &lt;code&gt;supertest&lt;/code&gt; library to request the first mock created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I ran this test I was expecting a status &lt;code&gt;200&lt;/code&gt;, but I got was an &lt;code&gt;400&lt;/code&gt;. I try to add paths to the mock to see if I can get results.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; 
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; 
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ok&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I still got the &lt;code&gt;400&lt;/code&gt; status.&lt;/p&gt;

&lt;h3&gt;
  
  
  correct way of connecting
&lt;/h3&gt;

&lt;p&gt;After talking to Roxanne, I found out what I did wrong. Firstly, when I add my mock, the &lt;code&gt;method&lt;/code&gt; and &lt;code&gt;path&lt;/code&gt; was wrong. My method was missing the &lt;code&gt;POST&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Secondly, my path was incorrect. It should not be use as a path parameters, instead it should've been a query parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/posts/post/_search&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The query format is found in the &lt;code&gt;search.js&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;hits&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;calculateFrom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;perPage&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;perPage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;_source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason why it's &lt;code&gt;/posts/post/_search&lt;/code&gt; because from the &lt;code&gt;search.js&lt;/code&gt; the variable are &lt;code&gt;index = 'posts'&lt;/code&gt; and &lt;code&gt;type='post'&lt;/code&gt;. If the path was not correctly call exactly, the test will return &lt;code&gt;400&lt;/code&gt;.&lt;br&gt;
The request now need the query function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Telescope&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I test run the test and it finally return &lt;code&gt;status 200&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I learn that the setup for mock Elasticsearch has to be very exact, anything wrong will results in a status 400. It was frustrating trying to understand what I did wrong even though it was a very simple fix.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Prerelease 2.6</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Sun, 06 Feb 2022 22:39:16 +0000</pubDate>
      <link>https://dev.to/jiahuazou/prerelease-26-2imh</link>
      <guid>https://dev.to/jiahuazou/prerelease-26-2imh</guid>
      <description>&lt;p&gt;Version 2.6 is coming soon. I have been working on the tests for the &lt;a href="https://github.com/Seneca-CDOT/telescope/tree/master/src/api/search"&gt;search&lt;/a&gt; function for Telescope.&lt;/p&gt;

&lt;p&gt;At first it sounded like a simple task, but when I start to dig into the problem it was getting a lot more difficult. The simplest thing that I did was to setup the initial setup for the tests. &lt;a href="https://github.com/Seneca-CDOT/telescope/commit/9cfc73ab1a52b47fd8c0261ddca4b68aa1f9df6c"&gt;Issue-2757&lt;/a&gt;. Even that had some problems. I thought the config setup was correct but later found out that the configuration was not properly setup even tho the test can still work fine. This was because when we ran the &lt;code&gt;jest&lt;/code&gt; command to run our test, the command included the setup config. We don't want that because different not all test will need the same setup.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;Before&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
 &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cross-env NODE_ENV=test LOG_LEVEL=error MOCK_REDIS=1 FEED_URL_INTERVAL_MS=200 jest -c jest.config.js --&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nx"&gt;After&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cross-env LOG_LEVEL=error jest -c jest.config.js --&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this change, each test can use their correct config file. After that, in the &lt;code&gt;jest.config.js&lt;/code&gt; for the search. I would need to add the proper setting so like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;baseConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../../../jest.config.base&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;baseConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;rootDir&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../../..&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;setupFiles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;rootDir&amp;gt;/src/api/search/jest.setup.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;testMatch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;rootDir&amp;gt;/src/api/search/test/*.test.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;collectCoverageFrom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;rootDir&amp;gt;/src.api/search/src/**/*.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;jest.setup.js&lt;/code&gt; is in the same directory as the &lt;code&gt;jest.config.js&lt;/code&gt;. All it does is to set a mock Elastic to 1(true).&lt;/p&gt;

&lt;p&gt;Once that is all setup, I can create my test file. If I do not create a test, Jest will throw an error when every we try to run the test command. So what I add was a simple test to test out if it can return error &lt;code&gt;400&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;supertest&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../src&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/query routers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;return error 400 if no params given&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;&lt;span class="s2"&gt;```



I know this will always be true because the connection to a mock elastic was not created. My next step would be trying to understand how we can create the connection to a mock elastic and dummy data.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Coming back for more - OSD700</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Sat, 15 Jan 2022 23:17:44 +0000</pubDate>
      <link>https://dev.to/jiahuazou/coming-back-for-more-osd700-2cl</link>
      <guid>https://dev.to/jiahuazou/coming-back-for-more-osd700-2cl</guid>
      <description>&lt;p&gt;After finishing my OSD600, I felt like I want to come back and learn more. This time it is more focus on the project &lt;strong&gt;telescope&lt;/strong&gt;. I am glad that my other courses did not overlap the slots for OSD700. &lt;/p&gt;

&lt;h2&gt;
  
  
  My Goal
&lt;/h2&gt;

&lt;p&gt;This time my goal for this course is to get in more depth on open-source code. I want to understand the back-end of &lt;strong&gt;Telescope&lt;/strong&gt;. As of right now I had to setup on my local computer. It took a while since there are a lot of documents to read. Did it felt like a Easter hunt.&lt;/p&gt;

&lt;p&gt;I had my first experience of the &lt;strong&gt;Triage meeting&lt;/strong&gt; with my classmates. We went over PR to see if we can close it and assign one or more of us to that PR if needed. After that we quickly went over the Issues. There was a lot of issues, so are from 3 years ago. Also, I will be a Sheriff with &lt;strong&gt;Tim Roberts&lt;/strong&gt; for next week.&lt;/p&gt;

&lt;p&gt;My first issue that I took is to add testing for the search function. &lt;a href="https://github.com/Seneca-CDOT/telescope/issues/2621"&gt;Issue-2621&lt;/a&gt; This won't be an easy task to do since there are endless possibility of testing. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This course will get really busy very soon but, I look very forward to contributing to this community.&lt;/p&gt;

</description>
      <category>opensource</category>
    </item>
    <item>
      <title>TESTING</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Sat, 15 Jan 2022 22:41:33 +0000</pubDate>
      <link>https://dev.to/jiahuazou/testing-103p</link>
      <guid>https://dev.to/jiahuazou/testing-103p</guid>
      <description>&lt;p&gt;JFDGKShtsrthhtdbrtgtnyuntbebgmgnmgm&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hello World</title>
      <dc:creator>Jia Hua Zou</dc:creator>
      <pubDate>Tue, 07 Sep 2021 19:02:11 +0000</pubDate>
      <link>https://dev.to/jiahuazou/hello-world-149o</link>
      <guid>https://dev.to/jiahuazou/hello-world-149o</guid>
      <description>&lt;p&gt;I'm Jia Hua and in the next 4 months my blog will be related to open source programs. I always had an interested in solving problems. &lt;br&gt;
 I wanted to take the open source class because back when I first try to contribute to open source program, I was overwhelm with the hundreds of files and lines of codes. I did not know where to start or how to contribute. Hopefully after taking this course, I will be more confidents on contributing to open source projects.&lt;/p&gt;

</description>
      <category>opensource</category>
    </item>
  </channel>
</rss>
