-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
setupTestFrameworkScriptFile option is missing #824
Comments
cc @cpojer, I don’t know anything about this |
@gaearon |
Does Jest intend to support jasmine-enzyme compatibility? I wouldn’t want to add support for something if Jest plans to change its extension mechanism soon. |
Would this distinction be useful to our users? Wouldn’t it be better to make |
I think so. It would be more helpful when As a user, I don't see any use case to run some code before test framework. Usually, I need to set up something via API that framework provides (which definitely should be after framework init), or mocking some global APIs, like |
See https://github.com/blainekasten/jasmine-enzyme/issues/39 We have some constraints at FB where we want certain files to be loaded before the test framework (env, polyfills etc.) and certain files after (to add to Jasmine). In the near future it should be enough to call |
@cpojer Even if special matchers API will be exposed, will it be available at @gaearon getting back to the general topic, do you mind to put |
Yes it'll be possible to extend |
As far as I see, recently released Jest 16 doesn't have this change. @cpojer do you have any estimation when it will become available? @gaearon nevertheless, I found another issue with current import expect from 'expect'; //here also can be chai, doesn't matter
expect.extend({/* my extra matchers */});
global.expect = expect; I'd like to define expect only once and then use it everywhere in my tests without explicit import, but it doesn't work. So, anyway |
@cpojer Are there any downsides to using |
I guess it should be fine. |
@just-boris Want to make a PR? |
Yes, I can do. |
Hello!
There is a convention to autoload
src/setupTests.js
file to set up the test environment, but it doesn't allow to load extra matchers for Jasmine.I have some library with good extra matchers like jasmine-enzyme and it is supposed to be included as
setupTestFrameworkScriptFile
, which it not possible to do now.The text was updated successfully, but these errors were encountered: