other-emerald
other-emerald8mo ago

Need help in testing create-refine-app package in local

I am currently working on fixing a bug in create-refine-app. To do so, I had to make some changes in the superplate-cli repository. I linked the superplate-cli local repository to the create-refine-app package locally. However, I am not sure how to test the create-refine-app package locally. As I am new to the JS/Node world, can you please share the best practices for testing such npm packages? I am stuck with the testing part and need some guidance.
3 Replies
kapa.ai
kapa.ai8mo ago
Hi @imtushardave. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The information extracts provided do not contain specific details on how to test the create-refine-app package locally, especially when changes have been made to the superplate-cli repository. However, I can share that refine's components and hooks are designed to be testable and work independently of each other. Refine itself is already tested by its maintainers, but you can write unit tests in your own code. It is also recommended to write end-to-end tests of your application. Refine uses the cypress (https://www.cypress.io/) framework as an example for testing, but you are free to use any framework you prefer. For more detailed information, you might find the refine documentation on testing (https://refine.dev/docs/testing/) helpful. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai8mo ago
<@704693720053841970> kapa.ai is still learning and improving, please let us know how it did by reacting below
other-emerald
other-emerald8mo ago
Hello @imtushardave In refine, repository, you need to bootstrap first, and then you can start which will build create-refine-app as you modify files:
npm run bootstrap -- --scope=create-refine-app

and then

npm run start -- --scope=create-refine-app
npm run bootstrap -- --scope=create-refine-app

and then

npm run start -- --scope=create-refine-app
Then you should run cli from dist folder:
node packages/create-refine-app/dist/index.js
node packages/create-refine-app/dist/index.js