Skip to content
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

fix: path for bin files #1107

Merged
merged 3 commits into from
Jun 5, 2020
Merged

fix: path for bin files #1107

merged 3 commits into from
Jun 5, 2020

Conversation

YoDaMa
Copy link
Contributor

@YoDaMa YoDaMa commented May 29, 2020

This is a fix from PR #1096 , which moved some of the CLI functionality into the bin folder.

We need to add some form of integration testing so this doesn't happen again...

Addresses: #1106

@YoDaMa YoDaMa requested review from OmgImAlexis and jdiamond May 29, 2020 16:23
@YoDaMa
Copy link
Contributor Author

YoDaMa commented May 29, 2020

@jdiamond if you have ideas on integration tests for CLI code, I don't have knowledge in that subject.

@YoDaMa
Copy link
Contributor Author

YoDaMa commented May 29, 2020

also should resolve asyncapi/website#107

Copy link
Contributor

@jdiamond jdiamond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on a fresh check out of master. Running ./bin/mqtt.js showed the MODULE_NOT_FOUND error. Running npm link and then mqtt showed the same.

Checked out this branch and both ./bin/mqtt.js and mqtt worked right away. Both mqtt pub and mqtt sub work. mqtt pub fails poorly with no arguments, but that's a different issue.

I don't know the "help-me" package, but it looks like the change you added comes from the main example in its README and it makes sense to me.

The "./.." in require('./../package.json') looks funny to me (I think the path could just be "../package.json"), but it seems to work. I tested the mqtt version command from different directories and it seems like it can always find package.json.

LGTM.

@jdiamond
Copy link
Contributor

Maybe a test could be to use child_process.exec to run node ./bin/mqtt.js and assert that the exit code is 0?

@YoDaMa
Copy link
Contributor Author

YoDaMa commented Jun 1, 2020

@jdiamond I'll add that test before I merge.

@OmgImAlexis
Copy link
Contributor

@YoDaMa did you want to merge and add the test after to get this back out and working for users?

@YoDaMa
Copy link
Contributor Author

YoDaMa commented Jun 5, 2020

Yeah let’s do that. I was going to get to the tests but I’ve been struggling to get anything done this week. Shit is heavy.

@YoDaMa YoDaMa merged commit 43cc1d1 into mqttjs:master Jun 5, 2020
PremiumBurger pushed a commit to quickstar/MQTT.js that referenced this pull request Nov 27, 2020
* fix: addressing

* fix: path

* chore: remove comments
@YoDaMa YoDaMa deleted the fix-bin branch February 10, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants