Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,162,543 members, 7,850,853 topics. Date: Wednesday, 05 June 2024 at 10:02 AM

Please Who Can Help Me Debug This Testing Code? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Please Who Can Help Me Debug This Testing Code? (312 Views)

Someone, Please Help Debug This Code / Can Somebody Help Me Debug This? / Debug This Code At Your Spare Time. (2) (3) (4)

(1) (Reply) (Go Down)

Please Who Can Help Me Debug This Testing Code? by DDayve: 6:58pm On Oct 05, 2021
I am a learner following coding along with an Udemy tutorial. Presently, i am in the section where i am learning testing.
This exact code, my instructor ran it and it worked but mine didn't work, i have carefully observed my code and compared to his, no difference. i have also applied my little knowledge to see where i am missing it, yet no solution. please i need somebody to rescue me.
the image of the codes are attached below

1. The first image is the script file
2. The second image is the first test testing the async await function. the test was successful
3. The 3rd image is the second test testing the promise function. The test wasn't successful and i expect it to be. They are suppose to be the same

Re: Please Who Can Help Me Debug This Testing Code? by angelEmade: 7:04pm On Oct 05, 2021
Are you sure this is not a library or compiler issue? Are you using the exact same compiler your instructor used?
Re: Please Who Can Help Me Debug This Testing Code? by DDayve: 7:12pm On Oct 05, 2021
angelEmade:
Are you sure this is not a library or compiler issue? Are you using the exact same compiler your instructor used?

Node of the codes worked at first, i had to uninstall the latest node-fetch which I installed to install the exact one my instructor used. There are two main packages my instructor used. 1. Jest and 2. node-fetch.
Since you have given me the opinion, i will have to downgrade the second package oo. Thanks boss, lemme try it.
I am just wondering if async await and promises will work differently on different compilers
Re: Please Who Can Help Me Debug This Testing Code? by angelEmade: 8:34pm On Oct 05, 2021
DDayve:


Node of the codes worked at first, i had to uninstall the latest node-fetch which I installed to install the exact one my instructor used. There are two main packages my instructor used. 1. Jest and 2. node-fetch.
Since you have given me the opinion, i will have to downgrade the second package oo. Thanks boss, lemme try it.
I am just wondering if async await and promises will work differently on different compilers
Well m more into php and native JAVA
While o can't exactly pin point a problem (assuming there is any) it is something I have learned over the years from my general knowledge of software development. In most cases compiler libraries and packages are the problem. If the code has an issue, m pretty sure your ide should throw an error especially if you are using one of these IDEs that's designed specifically for that programming lang.
Re: Please Who Can Help Me Debug This Testing Code? by DDayve: 8:42pm On Oct 05, 2021
angelEmade:

Well m more into php and native JAVA
While o can't exactly pin point a problem (assuming there is any) it is something I have learned over the years from my general knowledge of software development. In most cases compiler libraries and packages are the problem. If the code has an issue, m pretty sure your ide should throw an error especially if you are using one of these IDEs that's designed specifically for that programming lang.


Noted boss. Thanks. I will just assume async await is preferable for testing and move on. I have tried downgrading the second package but so many functionalities has been deprecated. As such, it didn't work. In fact, it was worst

(1) (Reply)

Learning Crypto From The Scratch As A Nigerian. Help! / Solve Technical Issues / Quick Sneak Peek Into A Work In Progress

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.