styled-components-test-utils
Version:
Test utils for styled-components compatible with jest, expect, chai and jasmine
28 lines (21 loc) • 843 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _styledComponents = require('styled-components');
var getStyleSheet = function getStyleSheet() {
if (_styledComponents.isStyledComponent) {
var secretInternals = _styledComponents.__DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS;
if (secretInternals === undefined || secretInternals.StyleSheet === undefined) {
throw new Error('Could not find styled-components v3 secret internals');
}
return secretInternals.StyleSheet;
}
try {
// eslint-disable-next-line global-require, import/no-unresolved
return require('styled-components/lib/models/StyleSheet')['default'];
} catch (e) {
throw new Error('Could not find module styled-components/lib/models/StyleSheet.js');
}
};
exports['default'] = getStyleSheet();