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

final commit, had a stab on the unit testing, but #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isaklafleur
Copy link

Hi,

I spend approx 6 hours to get this working. To bet the logic in place took 2 hours. Rest was spent on styling, refactor and trying to figure out how to do the unit testing with the github api... :)

I have tried to refactored the code as much as possible. Two questions I would like to ask and maybe can be answered on an possible future interview.

  1. What is best practice, to create the html-elements. In the html code or in the javascript code? I did both. Please see examples:

Here I create the html tags in the index.html and only updating the "innerHTML" of the tags in the javascript code.

      <div id="user-info">
        <div id="col-left">
          <img id="github-profile-image" alt="Profile Image">
        </div>
        <div id="col-right">
          @<i><span id="github-username"></span></i><br>
          <span id="github-fullname"></span><br>
          <span id="github-userbio"></span>
        </div>
      </div>

Here I create and append most of the html tags to this parent in the javascript code instead.
<div id="user-repos"></div>

  1. I tried to figure out how to do Unit Testing on the Github API. I know how to do it when functions returns values, but my functions only writes to the index file and do not return anything. Or maybe I misunderstood it.

Looking forward to hear from you!

Isak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant