Food-Static-Data / food-static-files-generator

Module that help to generate static JSON files with complex structure
3 stars 13 forks source link

Tests at generator module [discussion] #220

Open atherdon opened 5 years ago

atherdon commented 5 years ago

Is your feature request related to a problem? Please describe. @oksanafrankiv this will be our task for discussion tests at this simple module.

Partially - we start to add tests, but we never focused on 100% coverage. So let's make this current version of the module covered with tests and then we'll extend tests, because soon this module will be upgraded(major part will be the same, but logic will be less confusing and have less size)

Question: tell me about your JEST knowledge. it's totally fine if you'll need time to learn it. I have a lot of great resources, related to Jest lib.

atherdon commented 5 years ago

you may also watch this video: https://github.com/GroceriStar/food-static-files-generator/issues/209#issuecomment-519591165 it can help to understand what we're actually doing here

atherdon commented 5 years ago

another thread about tests: https://github.com/GroceriStar/food-static-files-generator/issues/132

oksanafrankiv commented 5 years ago

I don't have an experience working with JEST. I could use some resources to learn it.

I familarizing myself with the project. I've cloned the repository and ran tests.

atherdon commented 5 years ago

Today I make a review of code as well. Not sure actually if we have a lot of tests here, actually. But we'll make it work - i'll spend more time and prepare notes for tests

atherdon commented 5 years ago

this is my repository with articles about Jest. it's not formatted yet - lazy to do it. https://github.com/ChickenKyiv/awesome-jest-articles but take a look, please

This books is the best way to start from scratch: https://github.com/ChickenKyiv/awesome-jest-articles/blob/master/README.md#this-is-my-king-httpsflaviocopescomjest

but we need to keep a balance between learning and practice. because there a lot of tools at jest universe. So you can start with basic things and then we will start with simple tests only for practice. I'm a fan of practice, because it give a real experience.

atherdon commented 5 years ago

tell me if you'll have issues with local project setup. this is not a nodejs server project - it's not possible to run it locally without creating a build. and build is created by rollup - so things a tricky. but it;s a great workflow for coding independent modules

atherdon commented 5 years ago

tell me please also about your git skills as well. I have few courses prepared, can share them with you

oksanafrankiv commented 5 years ago

I didn't have problems with the project set up. I have basic knowledge of GIT, but I would like to learn more about it. If you would share those courses with me that would be great! Thanks!

atherdon commented 5 years ago

Sure, I'll share them soon

oksanafrankiv commented 5 years ago

I reviewed lots of materials about Jest over the couple days. Now I want to try to wright some tests. Could you please specify which functions should be covered by tests first? Any suggestions where to start, any notes would be greatly appreciated.

atherdon commented 5 years ago

Sure, will do it today it's also a good time for writing tests at this module - we have a big update coming, but right now we didn't start to work on it. and I saw that here we have a lot of code commented on test.

atherdon commented 5 years ago

please check this video: https://www.loom.com/share/71d0764686b34482b118e560f11ff974

atherdon commented 5 years ago

as mentioned, links to my 2 git courses: The first course was touching only basics, but I share some cool insights there as well. Free link: https://www.udemy.com/course/git-basics-and-merging-process/?couponCode=HACKERNOONROCKS

the second course explore how to use git as team member free link: https://www.udemy.com/course/git-workflows-in-depth/?couponCode=EUGENE

atherdon commented 5 years ago

I assume we need to have a better plan because i feel like you stuck a bit. Just think that if you'll make a first pull request with your simple code changes - it'll be more easy for you to move it forward. I'm ok if you busy - take as much time as you want/need - just use me if you need help

vadim9999 commented 5 years ago

This comment is for me?

atherdon commented 5 years ago

@vadim9999 no, it's for @oksanafrankiv actually. But you have some time for some contribution - let me know

oksanafrankiv commented 5 years ago

I tried to make the pull request, but I'm denied the access to repository. It seems that I can't create the remote branch. Do you have any suggestions?

atherdon commented 5 years ago

Sure, no problem

we're using forking workflow - about details - check my 2nd git course - so in order to be able to code together -you should fork our main repository - put your changes at that forked version and only then you'll be able to open pull request

atherdon commented 5 years ago

@oksanafrankiv let's discuss what we should do next

oksanafrankiv commented 5 years ago

Yes, sure!

atherdon commented 5 years ago

1) I think we can add missing test for a method at fileSystem 2) we can make work index.test.js - main goal for that file: be less paranoid, and understand that methods, that we exporting to the outside(so they can be called by other modules) are connected/imported correctly and 3) as you may notice - we have file testMethods with 2 methods, that testing if generated json files have the correct structure. it was work-on-progress, but maybe we can slowly make it work and push me to finish tasks that i'm lazy to do now :)

btw, I'm making some changes at the configuration and inside at src folder, so you'll need to sync your fork when i'll push my changes. Also, I make a release to npm with changes from your last PR.

tell me what do you think and what we should do next

oksanafrankiv commented 5 years ago

Sounds good. I'll work on those files.

atherdon commented 5 years ago

let's pick one of those options :) tell me what item you'll start to work on?

btw, i made changes at main repository - please sync your fork. if it'll be not clear - tell me - i'll help

oksanafrankiv commented 5 years ago

Ok I'll work on option 1.

atherdon commented 5 years ago

ok, cool - if you need help of stuck at something - just open new PR and i'll be able to look at your code changes locally

oksanafrankiv commented 5 years ago

I'll work on option 2.

atherdon commented 5 years ago

ok, great - tell me if you need more information