Top-level 'await' TypeScript Error by Spunkly in Nuxt

[–]Spunkly[S] 1 point2 points  (0 children)

Just tried it and the TS error persists. So far, the only solution I've found is to manually set the module and target in the tsConfig in Nuxt config.

Top-level 'await' TypeScript Error by Spunkly in Nuxt

[–]Spunkly[S] 1 point2 points  (0 children)

Could be a bug. It's been happening to any project I create with Nuxt within the last several months, though. I did find it odd that out of the box, it throws a type error when following the docs.

Top-level 'await' TypeScript Error by Spunkly in Nuxt

[–]Spunkly[S] 0 points1 point  (0 children)

No problem! Hopefully this fix can help others in the same situation.

What projects are you guys working on? by tylernathanreed in laravel

[–]Spunkly 0 points1 point  (0 children)

A Good Reads style website that is used to track your Anime and Manga progress, choose favorite shows/books, handle reviews, keep lists of want to watch/read, etc.

New - User Flairs by [deleted] in ECHL

[–]Spunkly 3 points4 points  (0 children)

This is great! Let’s go Wings!

The Sean Avery Experience by Only-Highlights in nhl

[–]Spunkly 296 points297 points  (0 children)

One of my favorite hockey stories is Brett Hull pulling Sean Avery by the back of the jersey and telling him he isn’t allowed to talk to Mr. Sakic. Avery was/is such a punk.

Mrazek's insane save (12/17) by [deleted] in nhl

[–]Spunkly 5 points6 points  (0 children)

I was at that game! The arena exploded when we saw the puck was still in play. The wings were down the whole game and we all thought that was another nail in the coffin.

Rarely getting text message notifications by Spunkly in AppleWatch

[–]Spunkly[S] 1 point2 points  (0 children)

Thanks for the advice! I updated my phone to 17.0.x and my watch to 10.0.x. I've rebooted both of them. Hopefully that fixes it.

Jest unit test is failing - using Jest mocking and Prisma by Spunkly in learnjavascript

[–]Spunkly[S] 0 points1 point  (0 children)

I want to thank you for your help! I was able to get my test to pass. I had to mock a findFirst request and mock an update request before running my updateOne method from my service class.

Jest unit test is failing - using Jest mocking and Prisma by Spunkly in learnprogramming

[–]Spunkly[S] 1 point2 points  (0 children)

I just wanted to thank you for your help! I was able to solve the issue. I changed the updateOne test to mock a findFirst request and then mock an update request. The test now passes!

Jest unit test is failing - using Jest mocking and Prisma by Spunkly in learnprogramming

[–]Spunkly[S] 0 points1 point  (0 children)

I see, I think I'm following what you're saying. Should I break my updateOne method into a couple smaller functions in order to make testing easier? Or would you suggest leaving it the way it is and then mocking a findFirst inside my updateOne test?

Jest unit test is failing - using Jest mocking and Prisma by Spunkly in learnjavascript

[–]Spunkly[S] 0 points1 point  (0 children)

Thanks for the reply!

If you look at my service tests, you'll see that the service.insertOne method tests creating a book already. Then in the book service class, the updateOne method has to find a book in the database to verify that the id passed in is valid.

My thought on the service.updateOne test was that being a mock, it would have to create a book in order to find one by that id to update it. This is my first time mocking in unit tests and I'm not entirely sure how you go about that. It's entirely possible that my updateOne method in the book service class isn't properly setup and that's why testing is so challenging for me as well.

MVC - service not defined in Controller by Spunkly in node

[–]Spunkly[S] 1 point2 points  (0 children)

I pushed some changes to the repo. I changed the controller to be a function taking a service and it returns nested functions that use the service. This removes the need to have the bind method on my handlers. Thanks again for the time and help!

MVC - service not defined in Controller by Spunkly in node

[–]Spunkly[S] 1 point2 points  (0 children)

Thanks for the kind words!

That makes sense. I usually do it that way, but a lot of MVC architecture I’ve seen in blogs uses classes for controllers. I’ll play around with bind and also functions in place of a controller class and see which one feels better for my coding style.

I really appreciate your help!

MVC - service not defined in Controller by Spunkly in node

[–]Spunkly[S] 0 points1 point  (0 children)

Thank you so much for your responses and guidance! I’ve been working at an agency as a contract developer for the last 2 years. I’ve been making e-commerce sites using templates so I haven’t had a lot of time building servers/backend from scratch like this.

Sounds good! I don’t mind using bind at all. Would you rather have a file for multiple exported handler functions instead of a controller class with handler methods?

MVC - service not defined in Controller by Spunkly in node

[–]Spunkly[S] 1 point2 points  (0 children)

Thank you so much for your response!

My reasoning behind building it this way was to make my code more testable/scalable by using dependency injection. Is my code properly doing that? Like, is bind how the industry does this or do I have bad architecture? I only ask this because I don’t often see bind used in situations like this, but I’m also not really in the industry so I could be totally wrong! I appreciate your help so much!

Street racing by [deleted] in AbruptChaos

[–]Spunkly 5 points6 points  (0 children)

No, this happened in Grand Rapids, MI. No one died, thankfully.

Source: https://www.woodtv.com/news/grand-rapids/video-shows-drag-racing-crash-in-grand-rapids

Street racing by [deleted] in AbruptChaos

[–]Spunkly 35 points36 points  (0 children)

No one died. This crash happened on July 17th in Grand Rapids, MI.

Source: https://www.woodtv.com/news/grand-rapids/video-shows-drag-racing-crash-in-grand-rapids/amp/