paul
paul
TTCTheo's Typesafe Cult
Created by fmdatalab on 1/8/2023 in #questions
Hide console.error when mocking error response in jest?
Spitballing here... - I could imagine maybe writing your own it.silent function that runs the test you pass it, but stubs out error printing and restores it after? - Override toString as a noop just for the error classes that you expect to be thrown? - Patch jest.fn, mockImplementation, and mockRejectedValue to intercept the error and re-throw it with some added property that will tell your logger/console to ignore it?
3 replies
TTCTheo's Typesafe Cult
Created by fmdatalab on 1/8/2023 in #questions
Hide console.error when mocking error response in jest?
I haven't done this, but I've had the same problem and would be interested in finding out what others have done
3 replies
TTCTheo's Typesafe Cult
Created by paul on 12/25/2022 in #questions
Old codebase, outdated tool chain - how to limit the blast?
True(*) but that one's the easiest to upgrade. You can have tests that run in jest and tests that run in vitest, and migrate over time. Nor is the interface difference a big change. Bigger worry is Enzyme is basically unsupported on React 17, and completely unsupported in 18, so there will be a lot of test rewriting where we use it. * Edit: actually no, dev workflow speed is a good reason to change most anything. Not a good reason to make unsafe changes, not a good reason to sacrifice customer experience (outside of a startup), but speed of feedback is the root of pretty much every good technical practice. We need to take it seriously and not treat it as the luxury of greenfield teams
25 replies
TTCTheo's Typesafe Cult
Created by paul on 12/25/2022 in #questions
Old codebase, outdated tool chain - how to limit the blast?
I like my tests to run fast.
25 replies
TTCTheo's Typesafe Cult
Created by paul on 12/25/2022 in #questions
Old codebase, outdated tool chain - how to limit the blast?
It's not a money-making tool, but it's very valuable. I thought by saying it was 5-6 years old I was implying that the company has kept using it for that long. We wouldn't have done that if it didn't do a useful job
25 replies
TTCTheo's Typesafe Cult
Created by paul on 12/25/2022 in #questions
Old codebase, outdated tool chain - how to limit the blast?
Thanks for the suggestions all. Rewrite (of the build scripts, that is, not the whole app) may truly be the only option, but I can't call it "saving the headache". @lee do you have experience with what you outlined? The way I read it, in the middle of the port I would have two React apps, each with part of the functionality, which wouldn't really give me a way to deploy my changes midway. Might as well be a full rewrite.
25 replies
TTCTheo's Typesafe Cult
Created by harshcut on 12/23/2022 in #questions
Want to create a collaborative editor with Next.js
I never used it, but I wouldn't have guessed there are problems with that combo. What specific issues are you having?
12 replies
TTCTheo's Typesafe Cult
Created by AdmiralGeneralAladeen on 9/26/2022 in #questions
What's the best way to bulk insert with a many-to-many relationship (posts & categories) in prisma?
But also since this is a one-time job, consider maybe dropping out of prisma and using SQL if you think that will let you get done faster
18 replies
TTCTheo's Typesafe Cult
Created by AdmiralGeneralAladeen on 9/26/2022 in #questions
What's the best way to bulk insert with a many-to-many relationship (posts & categories) in prisma?
ok, if 30k and it's a one-time job, I might just say do it the slow way. If it runs a long time it runs a long time.
18 replies
TTCTheo's Typesafe Cult
Created by AdmiralGeneralAladeen on 9/26/2022 in #questions
What's the best way to bulk insert with a many-to-many relationship (posts & categories) in prisma?
(and what is this for? testing I guess?)
18 replies
TTCTheo's Typesafe Cult
Created by AdmiralGeneralAladeen on 9/26/2022 in #questions
What's the best way to bulk insert with a many-to-many relationship (posts & categories) in prisma?
how slow is it to do them in a loop?
18 replies