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
Write tests for publishing #107
Comments
Posted by @mitchellhamilton here
The Verdaccio idea is quite nice and could be setup. How would you run tests against actual registries? Or maybe you have not meant the "official" registries like npm, yarn, and github packages? |
:) just 🚶🏼 around ... I could support this ( I haven't checked the code yet) but I use a lot changeset :) and pretty happy. |
Thanks @Andarist and @mitchellhamilton could be nice yes.
I'm not sure there's a need to ? Verdacio seems to follow the same protocol (some things maybe https://verdaccio.org/docs/cli-registry/ might have to be set either in npmrc, either though npm config). At first sight it seems realistic. For the multiple package manager tests (npm, yarn, pnpm), I've added a note in #674 (comment) (look section about unit tests). It's worth considering, not saying it should be done. |
I agree with the principles laid out here - although if it's not too hard to pull off I usually prefer e2e/integration tests over units. My users don't care that much how I've implemented a particular thing and how many external dependencies I've used - if they contain bugs then it's affecting my product/tool directly and it's still important for me to test if a particular dependency satisfies my requirements. Not every e2e scenario is easy to set up and I would classify this one here as something that is definitely not easy to set up. And as I said - I'm OK with testing such things by mocking stuff etc. The problem is that those commands don't only accept the given arguments - if that would be the case then I wouldn't be much worried about the whole thing. Their execution is sensitive to cwd, env variables and the file system structure itself (
Yes, it seems that this could be enough - I've looked now through the npm docs and it also seems that we can configure both the user and global config files to be used. So we could just "mock" them with a custom Verdaccio-powered We could even potentially use
@juanpicado would you like to help us out with setting this up? This could give us a good headstart. |
I'm thinking we could use https://verdaccio.org rather than mocking so we're actually testing against a real npm registry.
I've done a little bit of looking and it seems as though verdaccio doesn't support 2fa so we couldn't test that but we could at least test the core publishing flow.
The text was updated successfully, but these errors were encountered: