How web works ?
What happens when we enter a URL like https://en.wikipedia.org in a browser ?
DNS Lookup
The browser contacts a server on internet called a DNS server and asks it, “What is the IP of “en.wikipedia.org ?”. DNS server transforms domain names into IP address. For example DNS server response for this case could be “198.35.26.96”.
Connect to IP address and fetch the HTML page
The browser send an HTTP GET / HTTP request to the web server running on the computer at that address.
HTTP is a protocol which allows the fetching of resources such as HTML documents. Its the foundation of data
exchange on the web.
Render HTML web page
The browser takes the HTML response returned by the server and renders it as a web page. HTML is a martup language, it is the standard for creating web pages.
References
What are Curry functions in JavaScript
Currying is a technique of evaluating function with multiple arguments, into sequence of function with single argument. That is, when we turn a function call add(1,2,3) into add(1)(2)(3) .
References
- https://codeburst.io/currying-in-javascript-ba51eb9778dc
Which one to choose Mocha or Jest
If you have a large project with the need for flexibility and customization then Mocha is probably the choice for you. If you have a smaller project and don’t need the extra setup and configuration up front, Jest is probably the better option.
References
- https://blog.usejournal.com/jest-vs-mocha-whats-the-difference-235df75ffdf3
- https://medium.com/airbnb-engineering/unlocking-test-performance-migrating-from-mocha-to-jest-2796c508ec50
What is the difference between Mocha and Chai JS
Mocha provides developers with a base test framework, allowing you to have options as to which assertion, moking and spy libraries you want to use. Chai is one of the popular open-source assertion libraries used with Mocha.
References
- https://amzotti.github.io/testing/2015/03/16/what-is-the-difference-between-a-test-runner-testing-framework-assertion-library-and-a-testing-plugin/
- https://blog.usejournal.com/jest-vs-mocha-whats-the-difference-235df75ffdf3
Can Jest be used for unit testing Backbone Application?
Yes!! We can unit test Backbone JS applications using Jest
References
- https://github.com/captbaritone/tdd-jest-backbone
- https://medium.com/@michaelsholty/using-jest-snapshots-in-a-marionette-application-even-with-handlebars-f5c152525006