javascript testing code example
Example 1: what is jest
Jest is a JavaScript testing framework maintained by Facebook, Inc. with a
focus on simplicity.
It works with projects using: Babel, TypeScript, Node.js, React, Angular and
Vue.js.
It aims to work out of the box and config free.
Example 2: test() javascript
const str = "Hello World";
var item = /Hello/, // to define the item name use /item name/
result = item.test(str); //test() used to search for a specific item in strings
// returns "true"