Learn programming with KUMAR -
* Here programming made very simple
* Learn in easy way with practical
* Start from basic to advance
* Get ready for the job in IT Companies and start your career
* Help to build your project
* Live training courses completely free
* Free Live Chat for your doubts
* Interview preparation
Пікірлер
good example....where can i get the code for this?
today i completed , as of now i got a good idea about chai and mocha
@@user-wr1cl2ok4c thank you for following this.
Connecting Database from angular app, pls make a video
@@satishchandra3076 Dear Satish, angular does not connect directly with database. It connect with the database using API. Certainly I'll make the video on it. Thank you for your suggestion.
very confusing way to explain. All cluttered.
Hi Amil, what is you confusion ? Would you please explain a bit more. I would try to solve your query. Thanks
how import calculator can you please help me?
Hi Jyoti,this is just an example taken as Calculator class but you can you use your class in your project in a similar way of writing test cases.
Further you can use to import class like below code import Calculator from 'abs path for your file'; in case of default export
Exception during run: TypeError: Unknown file extension ".ts",how solve this error
Hi, Would you please install Chai later version "chai":"^4.3.7" to see if this solve your issue
How install
First of all remove existing Chai from your package.json file and then run npm i chai
Thank you
What is next command
Do you have js notes , Share Sir
Thank you. Code should be there in the GitHub link provided in the description. Please let me know if you don't find it.
Exception during run: TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" plz solve this error
Certainly I would help you on this. Could you please share yr package.json and tsconfig.json file to me.
very good explanation.
Thank you 👍
To solve the "TypeError [ERR_UNKNOWN_FILE_EXTENSION]" Install the version "^4.3.7" of chai
I solved the error installing that mentioned version of chai but why did it work?
@orlandopl267 good to know that you have solved issue by installing later version of Chai. Really not sure what could be reason behind it. However there was issue raised for this in Chai. Please see below link for for details. github.com/chaijs/issues/1568
Did you have to put this Subscription notification every minute?
Thanks for your suggestion, I have moved subscription notification in the last for all my later uploaded videos.
Great Tutorial. Thanks for the content
Thank you👍
You explained very clearly 👏
Thank you Prisca!!
Mast kaam krta hi bhai tum
Thank you Shreyash for comment!
Thank you for the content. I have a question. How do you mock, stub or spy an anonym function?
Thank you for your comment. Its a very good question , so I thought to make a video on this, which I have published it today. I hope this will be helpful to understand. Please let me know if you have if still you have any query. Link is given mentioned below: kzread.info/dash/bejne/pH13j6yMZJDKprg.html
amazing content bro
Thank you Adelminwer 👍
Thanks much 👍🏻
Thank you Zainab👍
kzread.info/dash/bejne/eHyBx7SDp7q-epc.html both are same or diffrent??
this is one part of the complete video. thank for checking.
very simple and best explanation.
Thank you for your comment !!
Thank bro. Very well explained
Thanks a lot for your comment 👍
Hi bro, i tried all the methods to solve but still i am facing the issue "hemanthc@Hemanths-MacBook-Air API-testing-pratice % npm run test > [email protected] test > mocha --require ts-node/register test/**.spec.ts Exception during run: TypeError: Unknown file extension ".ts" for /Users/hemanthc/API-testing-pratice/test/calculator.spec.ts at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9) at defaultGetFormat (node:internal/modules/esm/get_format:203:36) at defaultLoad (node:internal/modules/esm/load:143:22) at async ModuleLoader.load (node:internal/modules/esm/loader:409:7) at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:45) at async link (node:internal/modules/esm/module_job:76:21) { code: 'ERR_UNKNOWN_FILE_EXTENSION' }Z " can u help me
Certainly I would like to help.. Please let me know if we could connect on FB.
thank you sir, it was very helpful
Thank you for your valuable comment ! 👍
good job!, that's exactly what I was looking for
Glad I could help!
usefull and in depth explanation.
Thank you Manoj!
Useful tips thanks for sharing. Scope and hoisting are always hard concepts to understand. You went nice and slow.
Hi bro. Need you gmail id
nice but thoda zoom karo
Thank you!!
😔 'Promo sm'
The bell ring is so annoying
Thank you for letting me know.. I will take care of bell ring from all my upcoming video.
Best vdo on int
Thank you Shahrukh for your comment!
very informative video, i have a question, what if i use toPromise() with observables instead of promise? You can make a separate video on it. also explain await, async in the same video so that we'll get clear idea.
Thank you Aparna! .toPromise is utility method from Observable and that is used to convert an Observable into a Promise which resolve promise with the last emited value. Hope I have answered for your query. Certainly I will make an video on async and await soon. Thank you for your suggestion. Thanks
thank u@@kyprogramming
thanks for the detailed comparison....
Your welcome👍
Hi. Executed same actions with you but getting "TypeError: Unknown file extension ".ts" for ...path/calculator.spec.ts i have searched the error in google but recommended solutions causing other errors. Do you have any suggestion? Thx
If you're encountering an "unknown file extension .ts" error while using Mocha, it likely means Mocha doesn't recognize TypeScript files by default. To fix this, you can use a tool like ts-node to transpile TypeScript files on-the-fly before running tests. npm install --save-dev ts-node tsconfig-paths Also could please add .mocharc.json file.. { "extensions": ["ts"], "spec": ["**/*.spec.*"], "node-option":[ "experimental-specifier-resolution=node", "loader=ts-node/esm" ] } This could solve your problem. Please let me know if this solve your issue. Thanks
How is const a is accessible inside function second as its block scope?
Thank you Hema for your query.. Variable a is declared in global scope and it will be lexically scoped to all the child scope, therefore it's been accessible inside the block scope. I hope I have answered for your query.. Thanks
One genuine doubt of mine... Isn't this same as saying a =0 b =0 and hence a =b? no offence fantastic video!
Thank you Govind for your comment! If you are saying a=b it means you are assigning value of b to a. In order to check equality for a & b you should use == or === strict equality check operator like a === b or a == b. I hope I have answered for you query. Thanks.
@@kyprogramming No sir... In the test we are only setting the value for the mocked response(let say for the response status is always gonna be 200 because we have returned the same in the main file) and in the expect(res.status) we saying that it should be equal to 200 So its always gonna pass the testcase if you only change the status from 200 to 404 in the expect statement then only it will fail. So in this analogy isn't this same as that of saying let a = 0. and b = 0( 0 is nothing but mocked response and the expected response in the expect statement) and saying a = b. In that sense I was asking the question. Pls clarify this doubt of mine.
@@bgovindnaren7405 ok, got your point. whenever we are trying to test any functions , we should mock other dependencies with the some mocked response (should not necesary have the actulal response )and same can we verify under assert. The whole idea is to test functionality for the relevent function under a single test cases not to the it's dependencies. Also its depends upon requirements and use cases what exactly we have to test. In this tutorial I have explained how we can utilize nock libraby in order to mock our actual API functionality for GET and POST. Hope I make it clear to you.
where is interview questions and answer?
Hi Jaywant, this is mainly cover difference between difference among unit , integration and e2e testing and how to perform in angular. Please let me know if you are looking for any specific questions?
Thank you
Hi Kumar, how the deep copy is handling the function , whats the type of d key here ?
Hi Kavin , thank you for your comment.. JavaScript doesn't have a function data type but when we find the data type of a function using the typeof operator, we find that it returns a function. This is because a function is an object in JavaScript. Ideally the data type of a function should return an object but instead, it returns a function. I hope, I have answered for your query.
very well explained. keep it up
Thank you Ashish for your comment. 👍
great content
Thank you Ashish for your comment!
how excellent ur teaching style....super se upper
Thank you Prasanta!
Well explained sir
Great content sir . Thank you for the efforts . Keep growing 🎉
Thank you Sweta for your appreciation and liking my contents.
after esm:true :getting error TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/xainis/Documents/typescript/typePost/src/index.ts
Please install ts-node npm install -g ts-node And also remove type:module from package.json It should be working as expected. Please let me know if still you are facing issue..
@@kyprogramming already installed nodemon and ts-node
@@xaini-137 ok please let me know what time will be suitable for you, will setup a Google meet and certainly help you on this. Definitely there is some small configuration would be missing.. Also please let me know which nodejs version are you using?
v20.10.0@@kyprogramming
@@xaini-137 v20 should be good. Please contact me on telegram t.me/+lZMiJxI4GeNjY2Vl Will setup a meeting to resolve you issues free of cost.
Hi thanks for this video but when npm run test got the error TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
Hi Yann, have you installed ts-node? and please go step by step all the installation process. Still you are having any issue please connect me on facebook chat, certainly will help you on this.
the same add file .mocharc.json { "extensions": ["ts"], "spec": ["**/*.spec.*"], "node-option": [ "experimental-specifier-resolution=node", "loader=ts-node/esm" ] }
Could you please try to run following command : npm i tsc -g npm i typescript -g npm i ts-node -g And also ensure you have configuration in tsconfig.json file as "module": "commonjs" This should solve your problem. Please let me know if still you are facing this issue. Thanks
I can't use commonjs. The project has modules. Anyway the my way is works
@@user-cg1pq2kh6t great stuff! glad to hear your issue is resolved.
Thanks this is really helped me lot and keep it up bro
Thank you Naidu, glad to know; this video was helpful to you.
Excellent...Wishing you and your 👨👩👧👦 a year filled with ❤, laughter😄 and happiness🫶🏻. May this year bring lots of prosperity.✨Cheers to a fresh 🍃 start, limitless happiness💕 and new opportunities✌🏻. May this New Year bring you everything you desire and more a year of growth💗, positivity🌷, and achieving your goals☯. May each day of 2024 be a step towards a brighter future 🔮.
Thank you Prasanta for your beautiful comment.. Wishing you a year ahead filled with laughter, love, and limitless possibilities and endless learning. 👍🎊
Amazing, I am preparing for Interviews, your videos are very useful, in every video some new things is there to learn, please cover all the topics that's important for interviews
Thank you Veeresh, my aim is to complete all the JavaScript interview questions complete first.
EXPLANATION IS SUPER...GOOD KEEP IT UP
Thank you Prashanta👍
Very good explanation
Thank you Jayapala 🙏