From 594362b1ca20c01dac535c0d091d20fa87817f27 Mon Sep 17 00:00:00 2001 From: Mike Deverell Date: Mon, 15 Oct 2018 17:52:50 -0400 Subject: [PATCH] Remove object rest/spread notation to continue Node 6 support --- src/toHaveStyleRule.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/toHaveStyleRule.js b/src/toHaveStyleRule.js index c14fe5c..5fbf30a 100644 --- a/src/toHaveStyleRule.js +++ b/src/toHaveStyleRule.js @@ -101,12 +101,13 @@ const getDeclaration = (rule, property) => const getDeclarations = (rules, property) => rules.map(rule => getDeclaration(rule, property)).filter(Boolean) -const normalizeOptions = ({ modifier, ...options }) => - modifier - ? { - ...options, - modifier: Array.isArray(modifier) ? modifier.join('') : modifier, - } +const normalizeOptions = (options) => + options.modifier + ? Object.assign( + {}, + options, + { modifier: Array.isArray(options.modifier) ? options.modifier.join('') : options.modifier }, + ) : options function toHaveStyleRule(component, property, expected, options = {}) {