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 unit testing #579

Open
grunch opened this issue Aug 29, 2024 · 6 comments · May be fixed by #593
Open

Fix unit testing #579

grunch opened this issue Aug 29, 2024 · 6 comments · May be fixed by #593
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed 🪙 Reward in Sats ⚡

Comments

@grunch
Copy link
Member

grunch commented Aug 29, 2024

Since the bot started to work we create some tests but in some point tests stop working, we need to have them working again and start creating new ones.

The bot is getting bigger and now testing is essential, the goals of this issue is to fix the testing to make it work again and fix all tests we already have written, in the future we will create new issues to create new tests and have better testing coverage.

@grunch grunch added help wanted Extra attention is needed good first issue Good for newcomers 🪙 Reward in Sats ⚡ labels Aug 29, 2024
@danfercf1
Copy link
Contributor

danfercf1 commented Sep 12, 2024

Hi @grunch, which could be the main tasks here?

@grunch
Copy link
Member Author

grunch commented Sep 13, 2024

Hi @grunch, which could be the main tasks here?

As an initial test issue, we should fix the structure and all tests on https://github.com/lnp2pBot/bot/blob/main/tests/bot_test.js

@danfercf1
Copy link
Contributor

Alright, I can take this task, the first thing it's to move the names of the test files to .spec

@Catrya
Copy link
Member

Catrya commented Sep 14, 2024

Alright, I can take this task, the first thing it's to move the names of the test files to .spec

Hi @danfercf1 I assigned it to you

@danfercf1
Copy link
Contributor

Hi @grunch , I need a clarification for this file https://github.com/lnp2pBot/bot/blob/main/tests/bot_test.js, I was wondering if it's an integration test, or what is the main purpose of this file?, I've realized that it's making a connection to the DB, but in an unit test that's need to be mocked and it's using the bot instance to run the tests also

@grunch
Copy link
Member Author

grunch commented Sep 16, 2024

Hi @grunch , I need a clarification for this file https://github.com/lnp2pBot/bot/blob/main/tests/bot_test.js, I was wondering if it's an integration test, or what is the main purpose of this file?, I've realized that it's making a connection to the DB, but in an unit test that's need to be mocked and it's using the bot instance to run the tests also

Yes please, we need to do unit testing, all things that are wrong needs to be fixed, like replacing the DB connection with mock as you said

@danfercf1 danfercf1 linked a pull request Sep 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed 🪙 Reward in Sats ⚡
Projects
Status: 📝 In Progress
Development

Successfully merging a pull request may close this issue.

3 participants