raulvillares / 3sacrowd

Tic-Tac-Toe puzzle using plain javascript :video_game:
https://raulvillares.github.io/3sacrowd/index.html
35 stars 69 forks source link

add movement and movement total test #71

Closed garykhong closed 2 years ago

garykhong commented 2 years ago

Hi Raul Villares,

I'd like to contribute a simple unit test to infoTest.js where I test that the movement counter gets incremented from 0 to 1.

Kind Regards,

Gary Khong

titivermeesch commented 2 years ago

Hey @garykhong, thanks for your contribution.

I will add some Github actions to make all these run perfectly and will merge your work after it.

garykhong commented 2 years ago

Thanks @titivermeesch for accepting this. The Github actions sound interesting. What will you setup?

I was also thinking of unit testing board.js but a lot of the methods use the document object which doesn't exist when tape is run. What would be the best way to fake the document object?

titivermeesch commented 2 years ago

Thanks @titivermeesch for accepting this. The Github actions sound interesting. What will you setup?

I was also thinking of unit testing board.js but a lot of the methods use the document object which doesn't exist when tape is run. What would be the best way to fake the document object?

Sorry for this crazy late answer. I've moved the GH actions part to https://github.com/raulvillares/3sacrowd/issues/73

About the document object, I found this: https://stackoverflow.com/a/50629802/11750453