Not passed URL Shortener Microservice Project

Hi, I test my code and It works fine to fulfil the project stories, my test is not passed, why?

Here is my github repo:
Sereysopea-Ung/freecodecamp-urlshortener: This is test project (

Here is my project deployment:

Hi @Sereysopea-Ung
Which of the tests did not pass?

I did not pass Test 2 and 3, @theodoreonyejiaku

I don’t pass this test because I did not use dns.lookup(), i used regex instead


  1. For test 2: You have to get the hostname of the url in the request body. Then you use dns.lookup() to verify the hostname. The dns.lookup() will tell if the url is invalid or not. Using a regex might not work.
  2. For test 3: Make sure the find the shortUrl request parameter using findOne() of mongoose. Then use the select("-_id -__v") on the query if you don’t want these fields.
1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.