Newer to jest testing and reaching out to the community for direction. I need to write a jest test around the following block of code. The environment leverages jest, enzyme and chai. I have searched high and low for examples of optional chaining operator tests. Any examples or links anyone can provide to point me in the right direction.
<TableCell
key={i}
size={columnResizing?.columnWidths[column.id] || column.size}
/>
To enable optional-chaining, install it, like this:
yarn add @babel/plugin-proposal-optional-chaining --dev
After installing it, you need to ensure it's registered within your babel plugins section, like so:
{
"plugins": ["@babel/plugin-proposal-optional-chaining"]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With