jest-styled-components
Advanced tools
Comparing version 2.0.0 to 3.0.0-0
{ | ||
"name": "jest-styled-components", | ||
"version": "2.0.0", | ||
"version": "3.0.0-0", | ||
"description": "Jest utilities for Styled Components", | ||
@@ -18,8 +18,8 @@ "main": "./src/index.js", | ||
"devDependencies": { | ||
"babel-jest": "^19.0.0", | ||
"babel-preset-es2015": "^6.24.0", | ||
"babel-preset-react": "^6.23.0", | ||
"babel-jest": "^20.0.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"chalk": "^1.1.3", | ||
"enzyme": "^2.7.1", | ||
"enzyme-to-json": "^1.5.0", | ||
"enzyme": "^2.8.2", | ||
"enzyme-to-json": "^1.5.1", | ||
"eslint": "^3.17.1", | ||
@@ -30,12 +30,12 @@ "eslint-config-airbnb": "^14.1.0", | ||
"eslint-plugin-react": "^6.10.0", | ||
"jest": "^19.0.2", | ||
"jest-diff": "^19.0.0", | ||
"jest-snapshot": "^19.0.2", | ||
"pretty-format": "^19.0.0", | ||
"react": "^15.4.2", | ||
"react-addons-test-utils": "^15.4.2", | ||
"react-dom": "^15.4.2", | ||
"react-test-renderer": "^15.4.2", | ||
"jest": "^20.0.0", | ||
"jest-diff": "^20.0.0", | ||
"jest-snapshot": "^20.0.0", | ||
"pretty-format": "^20.0.0", | ||
"react": "^15.5.4", | ||
"react-addons-test-utils": "^15.5.1", | ||
"react-dom": "^15.5.4", | ||
"react-test-renderer": "^15.5.4", | ||
"strip-ansi": "^3.0.1", | ||
"styled-components": "^1.4.4" | ||
"styled-components": "rc" | ||
}, | ||
@@ -47,10 +47,9 @@ "dependencies": { | ||
"chalk": "^1.1.3", | ||
"jest-diff": "^19.0.0", | ||
"jest-diff": "^20.0.0", | ||
"jest-matcher-utils": "^19.0.0", | ||
"jest-snapshot": "^19.0.2", | ||
"jest-snapshot": "^20.0.0", | ||
"strip-ansi": "^3.0.1", | ||
"styled-components": "^1.4.4" | ||
"styled-components": "^1.4.6" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node", | ||
"snapshotSerializers": [ | ||
@@ -57,0 +56,0 @@ "enzyme-to-json/serializer" |
@@ -12,3 +12,3 @@ const chalk = require('chalk') | ||
(isAddition(line) || isDeletion(line)) && | ||
(/\.[a-zA-Z]+/.test(line) || /className="[a-zA-Z]+"/.test(line)) | ||
(/\.[a-zA-Z]+/.test(line) || /className="(sc-)?[a-zA-Z ]+"/.test(line)) | ||
) | ||
@@ -15,0 +15,0 @@ |
const css = require('css') | ||
const styleSheet = require('styled-components/lib/models/StyleSheet') | ||
const { ServerStyleSheet } = require('styled-components') | ||
@@ -21,3 +22,3 @@ const getClassNames = (node, classNames) => { | ||
const className = rule.selectors[0].split(/:| /)[0] | ||
return classNames.includes(className.substring(1)) | ||
return classNames.includes(className.substring(1)) && rule.declarations.length | ||
} | ||
@@ -43,3 +44,5 @@ | ||
const getStyles = (classNames) => { | ||
const styles = styleSheet.rules().map(rule => rule.cssText).join('\n') | ||
const styles = ServerStyleSheet | ||
? new ServerStyleSheet().getStyleTags().match(/<style[^>]*>([\s\S]*)<\/style>/)[1] | ||
: styleSheet.rules().map(rule => rule.cssText).join('\n') | ||
const ast = css.parse(styles) | ||
@@ -52,3 +55,3 @@ const filter = filterNodes(classNames) | ||
return css.stringify(ast) | ||
return css.stringify(ast).trim() | ||
} | ||
@@ -55,0 +58,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9715
185
1
2