Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove object rest/spread notation to continue Node 6 support #196

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/toHaveStyleRule.js
Expand Up @@ -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 = {}) {
Expand Down