Skip to content
Advertisement

How can I test for object keys and values equality using Jest?

I have a mapModule where I import components and export them:

JavaScript

How can I test that mapModule has the correct exported keys, values and that they are not null or undefined?

Advertisement

Answer

In version 23.3.0 of jest,

JavaScript

expects a string.

Use:

JavaScript

result is passing test

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement