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
What is a HttpOnly cookie?
HttpOnly is an additional flag included in Set-Cookie HTTP response header. Using the HttpOnly flag when generating a cookie helps mitigate the risk of client side script accessing the protected cookie (if the browser supports it).
References
- https://www.owasp.org/index.php/HttpOnly