Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

it each jest

test.each([
  {a: 1, b: 1, expected: 2},
  {a: 1, b: 2, expected: 3},
  {a: 2, b: 1, expected: 3},
])('.add($a, $b)', ({a, b, expected}) => {
  expect(a + b).toBe(expected);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to remove whitespace in javascript 
Javascript :: first n elements of array js 
Javascript :: jquery select input value empty and hasclass 
Javascript :: NodeJS router model 
Javascript :: js hex encode 
Javascript :: scroll js 
Javascript :: defining functions in react 
Javascript :: mock createRef jest react functional component 
Javascript :: Loading "cdnify.js" tasks...ERROR 
Javascript :: javascript index of biggest number 
Javascript :: Algorithm used by strapi for password 
Javascript :: how to navigate to another page with settimeout reactjs 
Javascript :: header react native 
Javascript :: angular print html 
Javascript :: switch case statement in javascript 
Javascript :: numeros que mais se repetem em um array 
Javascript :: Fill in to get the value of the form field with id="name" and set it as the text of the paragraph with id="txt". 
Javascript :: js NumberFormat 
Javascript :: crud in node 
Javascript :: ejs docs 
Javascript :: how to check if expo app is running on the web 
Javascript :: e editable select no button 
Javascript :: javascript function to sleep 
Javascript :: js get target foreach 
Javascript :: react native select simulator 
Javascript :: mock function jest 
Javascript :: install video-react 
Javascript :: using dot prototype with constructor in javascript 
Javascript :: remove last element from an array 
Javascript :: omit object javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =