-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Jasmine support #55
Comments
@just-boris thanks for bringing this up. Can you post the code that is actually causing this to throw? There are a couple of assumptions made in the library about mocha being present, however these are mostly undocumented features which are used internally at Airbnb but will likely be removed. Running I could be missing something though. A stack trace would be helpful. |
The error has been caused by describeWithDOM('<Component />', function() {
it('should be rendered without errors', function() {
const component = mount(<Component />)
})
}); The |
@just-boris I see. I think we should make some documentation changes to more accurately reflect what is necessary. There is a good chance that In order to use the
If you're running the tests in an environment with DOM API's, Let me know if that makes sense? |
Yes, I can set up jsdom by myself and it seems to be working. But |
@just-boris there is some discussion about creating additional test-runner-specific modules like |
This refactor addresses several issues regarding enzyme working in a variety of environments, and the library just generally not making any assumptions about the environment that tests will be run in. For the most part, this amounts to: - remove direct dependency on jsdom - remove direct dependency on sinon - remove assumed dependency on mocha Additionally, this change moves the code that was removed into separate modules that are defined in the packages folder. In this case we have added two modules: "enzyme-mocha" and "enzyme-sinon". This design will allow us to have one repo where all issues, code, and documentation regarding enzyme are centralized, but modules are still separated at the NPM level. This will allow us to make atomic releases across the modules more easily, as well as keep all of the discussion in one place. Left to do before this is mergable: [ ] Add a "guides" section in the docs explaining how to use enzyme in different environments [ ] Build a proper npm script to run an npm publish in the proper order for each module [ ] Add more meaningful tests for packages This PR addresses several issues that havee been brought up: - Fixes #55 - Fixes #47 - Fixes #44
As it follows from the docs
I tried to use it with Jasmine and it worked fine until I tried to use
mount
. I got the error.before
hook is the Mocha-specific thing, Jasmine has the similar thing namedbeforeAll
.Thanks for the awesome tool! It is really missing piece to my tests, but I can't use it due to lack of Jasmine support.
The text was updated successfully, but these errors were encountered: