What are Curry functions in JavaScript

Jul 10, 2019

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
Categories : JavaScript

Which one to choose Mocha or Jest

Jul 10, 2019

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
Categories : JavaScript

What is the difference between Mocha and Chai JS

Jul 8, 2019

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
Categories : JavaScript

Can Jest be used for unit testing Backbone Application?

Jul 8, 2019

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
Categories : JavaScript

What is a HttpOnly cookie?

May 25, 2017

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
Categories : HTTP