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
Making chai a dependency #32
Comments
Thanks for reporting @startgeek! Funny, @nventuro and I were talking about this exact thing earlier today. Actually chai is a peer dependency of this package. This means that you have to install both side by side. The reason we made it that way is that we wanted to make sure to be using exactly the same version of chai that the user of this package is using. However... I don't think this is a problem anymore after removing chai "autoinstall" in #18. We might be able to make it an actual dependency now, and the user experience will be a lot better. @nventuro What do you think? |
Hm, yes, I'm not sure why I made it a peer dependency on that peer, having a regular dependency makes sense. We should fix this for v0.4. |
I believe one step that could be taken before each commit is that I (as a developer ) make a clean fresh environment (probably on VMWARE) with truffle wired and a bunch of heavy contracts and test and before each commit, I could do:
|
oh and I have this question how I can use openzeppelin-test-helpers in migration files? |
@startgeek That's a bit unrelated to this issue, it sounds more like the kind of thing to discuss in the forum. 🙂 https://forum.zeppelin.solutions |
Hm, actually we still need chai as a peer dependency for this to work: openzeppelin-test-helpers/src/setup.js Lines 1 to 4 in 8a2de42
I'm willing to let go of this last bit of magic setup. I think it would be much better if we were completely agnostic to chai. 🙂 An ugly |
Wouldn't
We actually already do this :) I've set up a couple integration tests, and as you can see, they have |
No, we can use it internally without forcing users of test-helpers to use it too. |
@frangio we should make a decision about this for the v0.4 release. |
Do we want to remove auto installation of chai-bn? |
I'd rather keep boilerplate to a minimum, and |
Then we can make chai a dependency of test-helpers in order to use it internally (do we even need it anyway?) and additionally if chai is installed next to test-helpers, we can register the chai-bn plugin into it. What is magical about chai-bn though? It's a chai plugin... We can show people how to use it. |
I just stumbled upon this when using the latest test helpers. Seem strange to have to install both |
@jamesmorgan While I agree that it's annoying to have to install openzeppelin-test-helpers/package.json Lines 57 to 59 in 4fa2d9e
This should be enough but npm isn't loud enough about these. We are missing documenting this more clearly, but I'd much rather we removed the peer dependency entirely.
|
The docs now indicate that |
It's still bad UX that users have to install chai manually, due to test-helpers using it internally. |
Thank you for reporting @VanijaDev! No, it's not strange. I implemented it wrong and didn't test it correctly. 🤦♂️ I'm preparing a fix and will publish it in a short while. |
@VanijaDev v0.5.3 has been released with the fix. |
hey everyone what's up
it's kind of surprising for me too since truffle should come with chai natively but I guess it only has it in form of internal use and doesn't provide it to external modules such as openzeppelin-test-helper
missing chai dependency and when I npm install it manually it fixes here's a snapshot
The text was updated successfully, but these errors were encountered: