AboutMasters Computer Science student. I like developing software for distributed networks.
SkillsFrontend web stuff, Go, C, Kubernetes, Docker, Java, C++, some assembly
LocationSocorro, New Mexico
Joined devRant on 5/24/2021
Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
I’m so sorry if this is the place for questions. I’m terrified of stack overflow and have been searching for a week for a solution and can’t find one. This is for React.js people.
I was tasked to create a webpage with react. The limitation is, they did not wanna adopt the node.js dependency. I said ok, I’ll figure it out. You can inject react, material UI, and babel with script tags in HTML, then put ur lil components in it. I did that and it works beautifully.
However, now I have to write tests for this. I think it’s actually impossible without a way to render React, so I have to use the browser, or node, right? I convinced my boss to allow me to use a node.js container just for testing, which I thought would make my life easier.
I don’t know how to render this thing with node. It’s just an HTML file that pulls react via script tags, and idk how to serve html with node. Additionally, none of the React testing libraries seem to support testing a system that wasn’t designed to be served with node, at least not easily. My gut tells me that the complication with how things are imported contributes at least a little to this (dependencies pulled via script tags in the HTML file and made available to react through global const variables).
I could be wrong about any of this — im fairly new. But how tf do I go about testing these react components? For reference, if you go to Reacts docs, there’s a section called “add react to a page in one minute” that’s pretty much what I did.20
For the first time ever, I’m writing an academic paper while worrying it will be too long, as opposed to being too short. The difference with this paper is that it’s on something I’m passionate about. I’m having fun writing this one - I’m getting paid to do something that doesn’t feel like work. It really makes me think about what job I want to get after college. I understand it’s possible to work without feeling like you’re working, and that’s something I really want.9
I'm regretting trying so hard at my jobs. I get passionate and over perform, and because of that, I'm given more responsibility and put in more leadership roles with no more pay. I need to get better at doing the bare minimum and leaving the passion for home projects6