warengonzaga / magic-commit

You can do magicc, you can build anything that you desire. 🪄🔮💻
GNU General Public License v3.0
32 stars 5 forks source link

write a basic unit test for the command line app #10

Open warengonzaga opened 4 weeks ago

warengonzaga commented 4 weeks ago

Summary:

There's a basic test.js file in the root directory; however, it is not the actual test for the current version of the command-line app. We need a tailored unit test for the command-line app.

Goal:

Write a unit test specifically for the current version and feature of the command line app.

Let me know if you want to take this issue or have questions.

gitdevjin commented 4 weeks ago

Hi, Waren. I would like to work on this, may I try this?

Abhinav-Bansal751 commented 4 weeks ago

hi sir,i would also like to try this.

warengonzaga commented 3 weeks ago

Hey @gitdevjin and @Abhinav-Bansal751 feel free to submit your PR.

gitdevjin commented 3 weeks ago

@warengonzaga Thanks! :)

warengonzaga commented 3 weeks ago

Let me know which one of you can take it @Abhinav-Bansal751 @gitdevjin? So I can assign this issue.

gitdevjin commented 3 weeks ago

@warengonzaga I'll take it

warengonzaga commented 3 weeks ago

@warengonzaga I'll take it

Done! ✨

gitdevjin commented 3 weeks ago

Hi Waren, I tried to install your tool using npm install -g magicc but I couldn't even run it. Maybe my Macbook's problem. I tried all the solutions that are available Online, but none of them worked for me. I also tried to install it locally following Contributing.md. But it didn't work either. I am going to try to make it work. However, if I can't figure it out until tomorrow, I'll let you know; then probably you should assign others. Thanks!

warengonzaga commented 3 weeks ago

@gitdevjin Hey there. To install it locally, you must follow the following for your tests.

  1. yarn install
  2. yarn setup

Since you are using a MacBook, it should work as expected because it uses Linux commands.

I wouldn't recommend installing it using npm or yarn globally.

warengonzaga commented 3 weeks ago

Otherwise, you can use CodeSpaces and do the changes there.

Abhinav-Bansal751 commented 3 weeks ago

for those who are trying it in windows,and getting rm not recognized as internal or external command,try putting rmdir /s /q dist in clean script.This is for windows.now run npm run build,then npm run setup.Then u can use magicc command ig.I have Had got some peer dependency issues while doing npm install , and i resolved it with npm install --legacy-peer-deps.Hope it helps

warengonzaga commented 3 weeks ago

@Abhinav-Bansal751 might be a good addition to script in package.json file?

Then add yarn setup:windows command.

Abhinav-Bansal751 commented 3 weeks ago

Yes ,I have added "setup:windows":"rmdir /s /q dist && yarn build" in my latest commit to add context to git message PR. pls see to it.

warengonzaga commented 3 weeks ago

I think you replaced the code there; kindly take a look at my suggested changes. https://github.com/warengonzaga/magic-commit/pull/14#discussion_r1796464222

@Abhinav-Bansal751

warengonzaga commented 2 weeks ago

for those who are trying it in windows,and getting rm not recognized as internal or external command,try putting rmdir /s /q dist in clean script.This is for windows.now run npm run build,then npm run setup.Then u can use magicc command ig.I have Had got some peer dependency issues while doing npm install , and i resolved it with npm install --legacy-peer-deps.Hope it helps

I fixed this already @Abhinav-Bansal751 the easiest way to fix this is to remove those dependencies and add it again so that we can get the latest version. 😊

Because of that, it breaks our automated way to publish the NPM package.

warengonzaga commented 2 weeks ago

@gitdevjin how's your setup? Are you able to make any progress here? Let us know, I'm always here to help.

Abhinav-Bansal751 commented 2 weeks ago

for those who are trying it in windows,and getting rm not recognized as internal or external command,try putting rmdir /s /q dist in clean script.This is for windows.now run npm run build,then npm run setup.Then u can use magicc command ig.I have Had got some peer dependency issues while doing npm install , and i resolved it with npm install --legacy-peer-deps.Hope it helps

I fixed this already @Abhinav-Bansal751 the easiest way to fix this is to remove those dependencies and add it again so that we can get the latest version. 😊

Because of that, it breaks our automated way to publish the NPM package.

ohk,i didnt know about that earlier.

gitdevjin commented 2 weeks ago

Hi @warengonzaga. The application is now running; however, I'm encountering issues with the test suite. It seems that ava isn't recognizing the React syntax.

warengonzaga commented 2 weeks ago

We can remove Ava or XO there, as long as we can test if the CLI works properly.

warengonzaga commented 2 weeks ago

I'm not familiar with Ava and XO. It came with Ink when I generated the project. According to Copilot, Ava is used for running tests while Xo is used to lint the React. You can choose any other linting or test suite that suits our purpose. @gitdevjin

warengonzaga commented 1 week ago

@gitdevjin what's the progress here?

warengonzaga commented 1 week ago

What about using this @gitdevjin? https://github.com/vadimdemedes/ink?tab=readme-ov-file#testing

gitdevjin commented 1 week ago

@warengonzaga I apologize for the delayed response; I was occupied with midterms. I appreciate your suggestion and will give it a try. If I encounter any issues, I’ll reach out for help. Thank you for your understanding!

warengonzaga commented 1 week ago

No worries, @gitdevjin, just checking if you're stuck. I'm here to help.

gitdevjin commented 1 week ago

@warengonzaga I tried working on the test configuration issue, but I couldn’t get it to work. I think it might be best to assign it to someone else. Sorry for the trouble.