jest-styled-components
Advanced tools
Comparing version 6.3.0 to 6.3.1
@@ -7,2 +7,6 @@ # Changelog | ||
## [6.3.0](https://github.com/styled-components/jest-styled-components/compare/v6.2.2...v6.3.0) - 2018-11-10 | ||
### Added | ||
- [toHaveStyleRule] Ability to avoid passing the expected value and use the `.not` modifier (see [#206](https://github.com/styled-components/jest-styled-components/pull/206)). | ||
## [6.2.2](https://github.com/styled-components/jest-styled-components/compare/v6.2.1...v6.2.2) - 2018-10-21 | ||
@@ -9,0 +13,0 @@ ### Fixed |
{ | ||
"name": "jest-styled-components", | ||
"version": "6.3.0", | ||
"version": "6.3.1", | ||
"description": "Jest utilities for Styled Components", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -19,5 +19,6 @@ const { matcherTest, buildReturnMessage } = require('../utils') | ||
const received = mergedStyles[camelCasedProperty] | ||
const matches = matcherTest(received, expected) | ||
// if expected value is not passed and we have a negated ".not" modifier we need to flip our assertion | ||
const pass = !expected && this.isNot ? !matches : matches | ||
const pass = | ||
!received && !expected && this.isNot | ||
? false | ||
: matcherTest(received, expected) | ||
@@ -24,0 +25,0 @@ return { |
@@ -126,5 +126,6 @@ const { getCSS, matcherTest, buildReturnMessage } = require('./utils') | ||
const received = declaration.value | ||
const matches = matcherTest(received, expected) | ||
// if expected value is not passed and we have a negated ".not" modifier we need to flip our assertion | ||
const pass = !expected && this.isNot ? !matches : matches | ||
const pass = | ||
!received && !expected && this.isNot | ||
? false | ||
: matcherTest(received, expected) | ||
@@ -131,0 +132,0 @@ return { |
@@ -6,3 +6,3 @@ interface AsymmetricMatcher { | ||
type Value = string | number | RegExp | AsymmetricMatcher | undefined | ||
type Value = string | number | RegExp | AsymmetricMatcher | undefined; | ||
@@ -18,4 +18,4 @@ interface Options { | ||
interface Matchers<R> { | ||
toHaveStyleRule(property: string, value: Value, options?: Options): R; | ||
toHaveStyleRule(property: string, value?: Value, options?: Options): R; | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36260
354