teachcode icon indicating copy to clipboard operation
teachcode copied to clipboard

Write unit tests

Open jamesgeorge007 opened this issue 4 years ago • 4 comments

As of now, we're missing out on unit tests which is extremely important. We're using avajs as the test runner.

  • [ ] teachcode init (@Ian-Yy)
  • [ ] teachcode submit
  • [ ] teachcode fetchtask <key>
  • [ ] teachcode showkeys
  • [ ] teachcode showcommands

jamesgeorge007 avatar Oct 01 '19 16:10 jamesgeorge007

Hi @jamesgeorge007 , I would like to try writing unit test for this

Ian-Yy avatar Oct 06 '19 15:10 Ian-Yy

@Ian-Yy sure, feel free to shoot up a PR :+1: First of all, pick up a command that you would like to work with.

jamesgeorge007 avatar Oct 06 '19 16:10 jamesgeorge007

@jamesgeorge007 I would like to do teachcode init first ya =)

Ian-Yy avatar Oct 09 '19 15:10 Ian-Yy

Hi @jamesgeorge007 , I've went through the code in init.js and Ava documentation but I'm really confused on how should I begin writing a Unit Test for this teachcode init. There's multiple parts that I don't know how to unit test such as inquire user to input their learning choice, name and Github username, on the creation/cloning of repository, and if the directories is already created.

Can you please provide some guide or how I should be actually writing the unit test for teachcode init. Really sorry, I'm still quite beginner in writing Unit Test. :pray:

Ian-Yy avatar Oct 14 '19 13:10 Ian-Yy