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

@emotion/jest

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emotion/jest - npm Package Compare versions

Comparing version 11.3.0 to 11.5.0

10

CHANGELOG.md
# @emotion/jest
## 11.5.0
### Minor Changes
- [#2456](https://github.com/emotion-js/emotion/pull/2456) [`500cdd82`](https://github.com/emotion-js/emotion/commit/500cdd828b65ad4b778c8a1459094b099d50f08a) Thanks [@billyjanitsch](https://github.com/billyjanitsch)! - Support typings for Jest v27
### Patch Changes
- [#2457](https://github.com/emotion-js/emotion/pull/2457) [`218e4f78`](https://github.com/emotion-js/emotion/commit/218e4f78ca03b36cd8ed595bc1a93892b9783eda) Thanks [@jcleefw](https://github.com/jcleefw)! - Add `RegExp` as a valid type for the `target` option accepted by `toHaveStyleRule`.
## 11.3.0

@@ -4,0 +14,0 @@

10

package.json
{
"name": "@emotion/jest",
"version": "11.3.0",
"version": "11.5.0",
"description": "Jest utilities for emotion",

@@ -24,6 +24,6 @@ "main": "dist/emotion-jest.cjs.js",

"specificity": "^0.4.1",
"stylis": "^4.0.3"
"stylis": "^4.0.10"
},
"peerDependencies": {
"@types/jest": "^26.0.14",
"@types/jest": "^26.0.14 || ^27.0.0",
"enzyme-to-json": "^3.2.1"

@@ -40,4 +40,4 @@ },

"devDependencies": {
"@emotion/css": "11.1.3",
"@emotion/react": "11.1.5",
"@emotion/css": "11.5.0",
"@emotion/react": "11.5.0",
"@types/jest": "^26.0.14",

@@ -44,0 +44,0 @@ "dtslint": "^0.3.0",

@@ -118,43 +118,42 @@ // @flow

const createConvertEmotionElements = (keys: string[], printer: *) => (
node: any
) => {
if (isPrimitive(node)) {
return node
}
if (isEmotionCssPropEnzymeElement(node)) {
const className = enzymeTickler.getTickledClassName(node.props.css)
const labels = getLabelsFromClassName(keys, className || '')
const createConvertEmotionElements =
(keys: string[], printer: *) => (node: any) => {
if (isPrimitive(node)) {
return node
}
if (isEmotionCssPropEnzymeElement(node)) {
const className = enzymeTickler.getTickledClassName(node.props.css)
const labels = getLabelsFromClassName(keys, className || '')
if (isShallowEnzymeElement(node, keys, labels)) {
const emotionType = node.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
// emotionType will be a string for DOM elements
const type =
typeof emotionType === 'string'
? emotionType
: emotionType.displayName || emotionType.name || 'Component'
if (isShallowEnzymeElement(node, keys, labels)) {
const emotionType = node.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
// emotionType will be a string for DOM elements
const type =
typeof emotionType === 'string'
? emotionType
: emotionType.displayName || emotionType.name || 'Component'
return {
...node,
props: filterEmotionProps({
...node.props,
className
}),
type
}
} else {
return node.children[0]
}
}
if (isEmotionCssPropElementType(node)) {
return {
...node,
props: filterEmotionProps({
...node.props,
className
}),
type
props: filterEmotionProps(node.props),
type: node.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
}
} else {
return node.children[0]
}
}
if (isEmotionCssPropElementType(node)) {
return {
...node,
props: filterEmotionProps(node.props),
type: node.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__
if (isReactElement(node)) {
return copyProps({}, node)
}
return node
}
if (isReactElement(node)) {
return copyProps({}, node)
}
return node
}

@@ -232,4 +231,4 @@ function clean(node: any, classNames: string[]) {

val &&
(!isTransformed(val) &&
(isReactElement(val) || (DOMElements && isDOMElement(val))))
!isTransformed(val) &&
(isReactElement(val) || (DOMElements && isDOMElement(val)))
)

@@ -236,0 +235,0 @@ },

@@ -46,3 +46,3 @@ // @flow

value: *,
options?: { target?: string, media?: string } = {}
options?: { target?: string | RegExp, media?: string } = {}
) {

@@ -49,0 +49,0 @@ const { target, media } = options

@@ -12,3 +12,3 @@ // Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>

export interface StyleRuleOptions {
target?: string
target?: string | RegExp
media?: string

@@ -15,0 +15,0 @@ }

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