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
require('jasmine-expect') API can only register watchers once #36
Comments
Thanks for this @michael42. Integration with Node is currently the most awkward aspect of this project. I agree that some kind of method is needed such as |
/cc to users who've opened issues on this project before, a question for you. How do you tend to include Jasmine Matchers on a Node.js project? I'm trying to think of what might be the best way to do it — and I'm pretty sure it will require an API change. Thanks. @Hemins @JessicaSachs @MathRobin @PaulTondeur @RALifeCoach @alecxe @anisylen @atruskie @cryptoquick @endorama @jasonjohnson115 @jelinson @jhuesos @jrencz @message @michael42 @mohit-excelindia @mrozbarry @mull @pavelmigolinets @rkawala @tandrewnichols @xuxiankun |
We're only including it once in our of our jest specs by simply importing it. Sorry I can't be of more help :/ |
Same as @mull. Include it once within our Jasmine specs and let it rip. |
Thanks @mull @anisylen. I had thought that just including Could it be that this has been fixed since it was opened? @michael42 can you confirm? Thanks. |
I can confirm the include as @mull and @anisylen are describing. |
We are including it in a helper file, and our setup looks like this: spec/support/jasmine.json: {
"spec_dir": "spec",
"spec_files": [
"**/*.spec.js"
],
"helpers": [
"helpers/*.js"
]
} spec/helpers/extra.js: // ...
require('jasmine-expect');
// ... |
Thanks all, ok I think this is working then and can be closed. |
Hi! You should post this on the readme.md. This is like a how-to-use with gulp-jasmine. Thanks! 👍 |
We're trying to use jasmine-expect to test a node.js application using gulp-jasmine. The current
require('jasmine-expect')
API isn't sufficient for that use case, since it only registers the matchers once. When the watcher runs the tests a second time, the require() result is already cached and the matchers aren't registered.A function that registers the matchers when called would solve this issue. Not sure how to integrate it without breaking backwards compatibility or registering the matchers multiple times, though.
The text was updated successfully, but these errors were encountered: