tempus
tempus copied to clipboard
Add unit tests
https://electronjs.org/spectron https://github.com/testing-library/react-testing-library
Tests that needs to be written : Test cases
I've forked, cloned and ran the application (nice work By the way!) and will implement some react unit tests for you.
I'm glad you like it ! Thank you ! If you have any question don't hesitate to ask them :D
Hi there! After getting everything setup, and calling a render() function from a test, I am getting an error regarding the electron API:
TypeError: Cannot read property 'on' of undefined
36 |
37 | // Listeners from the Tray menu
> 38 | window.ipcRenderer.on('start', () => {
| ^
39 | if (this.state.state === '') {
40 | this.start()
41 | } else {
I've tried importing the ipcRenderer into the react files and I can't seem to find any other supporting documentation on using the react-testing-library w/ electron. Do you know of other projects that have used the two frameworks together? I'm going to give it another investigation in a little bit, but thought I'd check with you as well.
Maybe we can use this : Spectron ? Also there is a complete boilerplate that uses Jest and React Testing Library, maybe we can get some inspiration from there https://github.com/react-boilerplate/react-boilerplate
Oh sweet! It looks like that will solve our problem! I can boot up the app with spectron and it looks like I can even use selenium within that (which is what I use at work). I could probably do quite a bit of testing for you too since I have experience with selenium. I'll send a PR with the basic framework and then continue building it out after that. thanks!
Nice ! Thank you so much :smile:
Managed to make it work !
This is being worked on #79
Dude! Nice work! If i can i'll try to get it running on my machine again. I have become very busy at work though, so no guarantees! But well done again!!
Thank's ! I don't have access to the Electron module for the tests in src so it's only to test the logic of the app and in public it have access to the modules but it still needs some configuration !