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 (github.com)

Here is my project deployment:
https://quiet-sierra-66561.herokuapp.com/

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

@Sereysopea-Ung

  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