-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Jest and renderIntoDocument #19
Comments
Having a similar problem. I made sure I'm on node v0.10.40 and using all the same devDep versions as the example app |
Same problem here: Using Jest CLI v0.7.1 | ^ 14 | ); 15 | 16 | var actualHeaderText = ReactDOM.findDOMNode(header).textContent; |
It turns out to be caused by a problem with the newer version (>6) of babel-jest. I fixed it by going back to an earlier version:
|
thanks. downgrading babel-jest also worked for me, but it is bad that we have to downgrade. This issue with babel-jest seems relevant...Anybody has anything new? |
After a bit of digging on this one, I came across the following steps to get these tests working with the latest version of babel-jest. Turns out jest needs a little more configuration... Firstly, I'm requiring the following devDependencies:
Create a new
https://babeljs.io/docs/plugins/preset-react/ Then add the following to
Now run jestjs/jest#554 |
Thanks @adam-cowley that did it for me. |
Honestly, emacs kills me a little every time I leave in a "u" or a "p" in the source code. This error in particular was an extra "p" in one unmocked module path for the Jest configuration, which throws really obscure errors. Thankfully this pointed me in the right direction: fedosejev/react-essentials#19 (comment) But holy 💩. Worst debug session ever, emacs is the worst.
as @rubenve mentioned, while in /snapterest folder do: then you can do |
Hi there, I've run into an odd issue with the unit tests. For the most part they work, but the renderIntoDocument seems to choke.
Here's the code for the test:
jest.dontMock('../Header.react');
describe('Header component', function () {
});
Here are the relevant lines from the dev dependencies in package,json:
Most of the other test succeed but this one (and the button tests) throw a syntax error. Unexpected token <. I assume is choking on the JSX. Have you seen this before?
The text was updated successfully, but these errors were encountered: