trying to setup jest to work with css decorators.
The css file linked to my react component has:
@import './another.css'
Now, when I run jest I get:
SyntaxError: /Users/thiagofacchini/Documents/atomix/src/library/atoms/Label/styles.css: Support for the experimental syntax 'decorators-legacy' isn't currently enabled (2:1):
Then I went to my .babelrc and added:
"env": {
"test": {
"plugins": [
"@babel/plugin-proposal-decorators", { "legacy": true },
]
}
Running jest again I get
[BABEL] /Users/thiagofacchini/Documents/atomix/src/library/protons/Animator/tests/index.test.js: The decorators plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean. If you want to use the legacy decorators semantics, you can set the 'legacy: true' option.
(While processing:/Users/thiagofacchini/Documents/atomix/node_modules/@babel/plugin-proposal-decorators/lib/index.js")
Also tried to change my .babelrc to:
"env": {
"test": {
"plugins": [
"@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true ,"legacy": true },
]
}
}
But get exactly the same error.
My package.json looks like:
"@babel/core": "^7.3.4",
"@babel/plugin-proposal-decorators": "^7.3.0",
"@babel/preset-env": "^7.3.4",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@logux/eslint-config": "^27.0.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.5",
NOTE: The error is just happening on JEST, my development build works fine.
I googled the hell but I simply cannot understand what's going on. Maybe something with versions? I'd appreciate any help.