Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-styled-components

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-styled-components - npm Package Compare versions

Comparing version 6.3.0 to 6.3.1

4

CHANGELOG.md

@@ -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

2

package.json
{
"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;
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc