Comments (32)
Also I really like your project and how you have communicated, it's been a pleasant experience. So I certainly would like to assist
from stargazed.
@JacobMGEvans Thanks a lot for that.
It's not everyday someone helps in such tiny OSS projects. Glad that you are ready to contribute. Appreciate it.
from stargazed.
@abhijithvijayan
Alright, I got this mostly figure out it was not configuration issues. The fact you were using a module.exports on an anonymous async function was making is impossible to test... I have some solutions,
-
firstly I am going to make the test work with the code as-is then make the PR
-
I am going to refactor it to use ES6 modules
import/export
which export default should would the same as how you havemodule.exports
with the testing in place we can refactor with confidence it will keep working as expected. -
Once the import/export is in place testing specific functions will be far easier and refactoring the code base will be far easier.
-
Integration and E2E(likely not needed) will be the next endeavor
from stargazed.
from stargazed.
@JacobMGEvans I think a lot of code refactoring is needed here and there in the source code. This was all written very soon so didn't get time to refactor.
from stargazed.
Wow! Congratulations, definitely a good idea to refactor for performance then!
You can assign other people, I probably will still write tests soon regardless. I am just finishing up with another issue from a different OSS and a few from my own side project.
from stargazed.
Last night I started focusing on the unit tests, I am having issues importing the functions and statements for some reason... Might need to spend a little more time on the jest configuration, not sure what's the exact problem yet.
from stargazed.
@JacobMGEvans Told ya, it's messed up.
from stargazed.
@JacobMGEvans I am open to any modifications as long as the project works and code quality is improved.
from stargazed.
@abhijithvijayan Interesting enough if I try to pass false into the options that are primitives is throws an error, if I pass true it works fine... I might open a bug issue a little bit
from stargazed.
@JacobMGEvans I was trying out the error fixes. Feel free to work on it.
from stargazed.
Could I get assigned to this?
from stargazed.
@JacobMGEvans How is that PR coming ?
from stargazed.
I did add exports to a lot of the functions in the file, but those can easily be removed when determined which ones are not needed for isolated testing.
I was also trying to get a feel for the codebase/the flow of data and how to approach testing it.
from stargazed.
Well, tests will definitely help when you go to refactor because you can just run watch on them and make sure the tests don't break :)
I try to write tests so the code implementation doesn't matter i.e. refactors dont break them... the only thing that matters is the input => output and behaviors remain the same/consistent.
from stargazed.
@JacobMGEvans You want me to assign this to someone else?
Refactor seems to be quite needed as CLI hit 2700+ weekly downloads.
from stargazed.
lmao, I am certain I can figure it out I just wanted to keep you updated
from stargazed.
Would you be able to give me some mock or actual payloads and responses? I would rather not go through the whole process if you have anything like that leftover from developing it.
from stargazed.
@JacobMGEvans I have fixed the export issue and also added a sample mock payload to the test file.
Now you can continue adding tests.
from stargazed.
Huh, it was working fine when I tested it locally... I use babel-node though
Glad you got it fixed though Ill check out the changes and continue with testing.
from stargazed.
Someone also uncommented out tests that I had TODOs on because they were incomplete and a comment was added that "it doesnt return anything" which is why there was a TODO there to finish the test...
from stargazed.
@JacobMGEvans Is babel config and its packages needed to run the tests?
from stargazed.
from stargazed.
https://jestjs.io/docs/en/getting-started#using-babel
from stargazed.
@JacobMGEvans The tests are almost complete right!
from stargazed.
from stargazed.
@JacobMGEvans not really.
CLI creates README.md, and local file is readme.md
If you have tried the cli within the folder, you can see it doesn't affect the original readme.md file
from stargazed.
I wasn't asking a question I was stating what happens when you run the function in the Jest test, also it is not cap sensitive, Node just writes to the readme.md, like I said.
from stargazed.
I thought since the command Node cli.js -u "USERNAME"
creates README.md
along with readme.md
, it wouldnt be a problem too, while testing.
Maybe renaming current readme.md
to just readme
might help right!
from stargazed.
from stargazed.
@JacobMGEvans A lot has changes since the last test added.
I have refactored the code a lot and it seems to be stable now. All the test suites are still working as expected.
Are you currently on other projects now for not be able to work on this issue anymore?
from stargazed.
from stargazed.
Related Issues (20)
- add CODE_OF_CONDUCT HOT 2
- add issue template HOT 1
- ADD contributing guidelines HOT 2
- Pipe chars don't get escaped (breaking markdown table) HOT 5
- Use babel npm package to transpile your ES6 to a commonjs target HOT 6
- Set up CI
- Add kodiak bot config
- replace npm badge with travis status badge HOT 3
- Disable linting the markdown file (template.md) HOT 9
- Run linting test in CI HOT 1
- add extension to eslint config file HOT 1
- Update check for global installation
- Code Refactoring
- [Bug] Bundle size too high HOT 2
- & resolving to & on markdown index links HOT 1
- Make commit message for GitHub actions with timestamp
- GitHub Action documentation HOT 3
- Maybe a hint for those who want to run and don't have a node (like me) but have a docker HOT 1
- Cannot read property 'login' of null error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stargazed.