You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is a jspm beta bug, a configuration issue or a karma-jspm issue, was hoping someone could shed some light. Consider the following test file:
import ReactTestUtils from 'react-addons-test-utils'
import HelloWorld from '../../src/client/index'
describe ( 'HelloWorld component', function () {
it ( 'should render "Hello World!" component.', function () {
var helloWorld = ReactTestUtils.renderIntoDocument( <HelloWorld /> );
});
} );
This throws an "Unexpected token" error because <HelloWorld /> is not being transpiled. The weird thing is that the'../../src/client/index' dependency also has components within it, and the JSX in those imported files get transpiled just fine. Only the JSX in the entry test file (containing the "describe" blocks) fails to be transpiled. Somehow "babel-plugin-transform-react-jsx" chooses to ignore the entry test file.
Although I'm using karma-jspm ( https://github.com/Workiva/karma-jspm ) to manage the tranpiling step, I believe this might be an jspm issue since it's responsible for detecting when a tranpiler is needed. Is there something I can do to force to the "babel-plugin-transform-react-jsx" to be active on those entry test files?
Transpiler config ( jspm version: 0.17.0-beta.12 [Running against local jspm install.] ):
m-a-r-c-e-l-i-n-o
changed the title
jspm 0.17 beta: babel-plugin-transform-react-jsx does not transpile all files
jspm 0.17.0-beta.12: babel-plugin-transform-react-jsx does not transpile all files
Apr 2, 2016
It was a jspm configuration issue, sorry about that. It appears that only files in the "src" (or whatever your app folder is) gets transpiled. Looking at the structure of the "jspm.config.js" file, I can now see how that makes sense.
Not sure if this is a jspm beta bug, a configuration issue or a karma-jspm issue, was hoping someone could shed some light. Consider the following test file:
This throws an "Unexpected token" error because
<HelloWorld />
is not being transpiled. The weird thing is that the'../../src/client/index'
dependency also has components within it, and the JSX in those imported files get transpiled just fine. Only the JSX in the entry test file (containing the "describe" blocks) fails to be transpiled. Somehow "babel-plugin-transform-react-jsx" chooses to ignore the entry test file.Although I'm using karma-jspm ( https://github.com/Workiva/karma-jspm ) to manage the tranpiling step, I believe this might be an jspm issue since it's responsible for detecting when a tranpiler is needed. Is there something I can do to force to the "babel-plugin-transform-react-jsx" to be active on those entry test files?
Transpiler config ( jspm version: 0.17.0-beta.12 [Running against local jspm install.] ):
The text was updated successfully, but these errors were encountered: