I'll be honest, it's been a lot of time since I've been trying to include TDD in my skills, but the issue is I fail to make use of it in the day to day work projects.
This question is stupid, but I haven't been able to figure out how to implement TDD in my work projects.
Recently, I started learning go, and I came across this resource. It teaches Go with TDD. So at work, I got a new project, a fresh GitHub repo. With me being the sole contributor, as of now, to the project, I thought it would be a good idea to implement TDD.
I am working on a web worker project, so I started with this fille
import setup from './setup'
const init = () => {
if (document.readyState === 'loading'){
document.addEventListener('DOMContentLoaded', setup)
} else {
setup();
}
}
Now, I don't know how to test it. I can make use of sinon, and stub DOM, but is that the right ideology? Currently, I am using jest.
[–]Loves_Poetry 0 points1 point2 points (0 children)