Telephone box library hit by thieves gets big makeover
'I have the best relationship with the Daily Mail - it has been everything to me. Why would anyone turn on the people who have helped their case the most?' In a profoundly moving interview, Stephen Lawrence's father breaks his silence and speaks his mind
Influencer Molly-Mae Hague enjoys a day off newborn duties as she enlists her team to take her photos at Wimbledon and reveals decision to stop breastfeeding son Midas after three weeks to 'end on a high'
The Middletons are here! Princess of Wales's parents Carole and Michael coordinate their Wimbledon looks in sweet matching moment at SW19
Furious Egyptians rant World Cup is 'RIGGED' as manager claims FIFA 'wanted Lionel Messi to stay in the tournament' after controversial VAR decisions in dramatic defeat
The secret team friction that undermines Norway's World Cup 'boys' trip' vibe: Player's dad opens up on his 'irritated' son's 'anger' before England's crunch quarter-final
Japan Releases Snowman-Like Asteroid Image After Flyby
Read more of this story at Slashdot.
Company director stole £550,000 of her elderly father-in-law's life savings to fund luxury Caribbean holidays, supplies for her horses and her daughter's wedding
Essex neo-Nazi who planned mass gun attack to be sentenced
Essex neo-Nazi who planned mass gun attack to be sentenced
I'm Reece James' dad - this is how he'll fight back to rescue England despite 10th hamstring injury in six years, forged by a childhood of tough standards, the car phone prank I played on him and the '20p game' with his sister Lauren
Migrant workers are still bringing in as many as 15 family members despite Government crackdown
NS&I accounts to snap up now - and the duds I'd avoid at all costs: SYLVIA MORRIS
All the tricks that will get you into VIP airport lounges for less this summer - even if you've booked economy
Virgin Media handed £28m fine by Ofcom for preventing contract cancellations
'An overwhelming vindication of our journalism': Prince Harry's phone hacking case against the Daily Mail is dismissed in full
CodeSOD: Module Test
TJ inherited a NestJS project. The original developers left the team many years ago, but they've left their mark in the codebase.
// ProjectsModule.ts @Module({ controllers: […], providers: […], exports: […], }) export class ProjectsModule {}NestJS is a dependency-injection oriented framework for TypeScript code. It offers "providers" (dependencies that can be injected), "controllers" (as one would expect), and lets you bundle them together into "modules". Modules can depend on other modules, letting you build a modular and flexible graph of dependencies. This means that the empty module isn't wrong here.
No, for it to be wrong, we need to write some tests:
// ProjectsModule.test.ts describe("ProjectsModule", () => { it("can be created", () => { const projectsModule = new ProjectsModule() expect(projectsModule).toBeTruthy() }) })Since modules are just containers for related code objects, there isn't much to test here. While "dynamic modules" which execute code are a thing, they don't execute that code at construction time anyway. This test will always pass. It isn't a test, it doesn't do anything. It likely doesn't even get their coverage up, since whatever providers or controllers it's referencing aren't covered by this test. It's a test that tests nothing but the framework it runs on top of.
"At least there are tests," TJ writes.
[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.