-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feature: add custom assertions via plugins #19
Comments
I was wondering the same thing today. While your suggestion is fine for node, how about browser support? Maybe this can even be achieved without changing anything. E.g. with Mocha your can require additional modules: mocha -r ./path/to/assertions -r morgan-assertions When using something browserify based this can also be done the same way. |
How would that work in browsers? Should the plugins export things into the global scope, that can be detected by |
The plugins can simply |
I am a bit slow today, would that make the config file obsolete? |
Yes. You'd essentially pass the file paths to require to the test runner instead. |
I think we'll need to create a running example of how this would work. Perhaps this can be the foundation of a how-to article about using custom assertions with |
This adds an example on how to load custom assertions as modules as described in https://github.com/sinonjs/referee-custom-assert-with-mocha to docs. See: sinonjs#19 A typo was fixed as well: helps -> help
👍 That's awesome, I've stolen your work for the docs 😁 |
Change bold text to 4th level heading See: sinonjs#19
* feat(docs): Add example on loading custom assertions with mocha This adds an example on how to load custom assertions as modules as described in https://github.com/sinonjs/referee-custom-assert-with-mocha to docs. See: #19 A typo was fixed as well: helps -> help
As an author, it is currently rather inconvenient to add custom assertions to
referee
.I always end up creating some meta file and importing that
This doesn't make it very convenient for me to re-use my domain specific assertions easily across repositories.
It would be really handy, if I could add custom assertions to
referee
via plugins, in the same fashion as plugins foreslint
.My custom assertions could then be published to an internal registry (or the public registry), and re-used across projects.
Thoughts?
The text was updated successfully, but these errors were encountered: