Ivan Milovanov
8 hours ago

Had the fortune to visit "Vermeer's Delft" (Het #Delft van #Vermeer) today. There's a lot to be said about it, all mostly good observations. But that's not what this toot's about. I'm here to bring to You the "ugly children of #art" mini #contest.

Of course, this is meant as a #jest in #goodfaith. Also, the images have nothing in common with the great artist, Johannes.

Please #choose the ugliest kid (#poll in the comments):

The Wailing Goblin (not the real title), depicting a Mother embracing her baby in green clothing.
The Changeling (not the real title), which is a zoomed in detail of a sculpture, showing a baby sucking on its mothers breast.
The Antichrist's First Steps (not the real title), a detail from a painting portraying a mischievous child trying to escape the dutiful clutch of its sibling.
Puppet Surrogate (not the real title), part of a painting of a Mother and her child looking inside from a window. There is a fly on the wall geneath them.
5 days ago

Do you have any tips on writing unit tests? How does one get better at making unit tests? or testing in general? seems like such a pain in the caboose I am using #jest at the moment should I just learn the framework more? trying to mock everything seems to take me an eternity sometimes.

#testing #webdevelopment

DAT :loading:
1 week ago

gerade wieder mal Stunden daran gescheitert #Node und #Jest zu debuggen


Das will man doch! Tests in die man nicht sinnvoll reinsehen kann! /s

Fabian Vilers
2 weeks ago

Unit testing #EcmaScript module code with #Jest and #Typescript is a #PITA.

2 weeks ago - Vitest: it's like #Jest but using #Vite loader, so no need for vue-jest, ts-node, etc, etc. And it loads with Vite, so it's fast. Runner in #VSCode:

#Angular CLI 16 introduces experimental first-class #Jest support with the @angular-devkit/build-angular:jest builder

Jamie Magee :unverified:
4 weeks ago

If you haven’t changed Jest's defaults your tests might be fragile, order-dependent, or just downright wrong. Check out my blog post where I dig into Jest's settings, and how you can fix your tests.

#javascript #node #jest #testing #unittest

Doug Parker
4 weeks ago

#Angular v16 launched today!

This is a feature-PACKED release including:

🚦 Signals in developer preview.
➡️ Required inputs.
💧 Non-destructive hydration in developer preview.
🧍‍♀️ Standalone APIs for #Universal and improved schematics.
🛠️ Faster builds with #ESBuild and #Vite in developer preview.
🃏 Experimental #Jest support.
🅰️ ... and way more!

Check out our blog post for all the deets.

4 weeks ago

Re: Moving #Angular CLI to #Jest and Web Test Runner:

I'm having mixed feeling about this. Deprecating Karma makes sense. Its architecture is 10+ yrs old. But since Facebook handed Jest over to the community, Jest is seriously under-maintained. It has become the proverbial project some random person in Nebraska is thanklessly maintaining.
If the Angular team is serious about this switch, Google should pay someone contributing to Jest.

#Testing #TDD #SoftwareTesting

1 month ago - set env vars for #Jest tests:

// jest.config.js
module.exports = {
setupFiles: ['<rootDir>/.jest/setEnvVars.js'],

Great quick tip
1 month ago

Here is our latest article on combining code coverage metrics from multiple #JavaScript tools to get the right info.

We explore how you can use IstanbulJS and nyc to combine code coverage details from #Jest and #Cypress

Check it out! #Testing #IstanbulJS #TechDebt

1 month ago

ICYMI: Stan Popovych published an article in the UpgradeJS blog about combining code coverage metrics from multiple #JavaScript tools to get the right info.

Check it out! #Jest #IstanbulJS

1 month ago

What happens when you have multiple tools testing your JavaScript app and you want a combined code coverage report? 

In this article we explain how to combine code coverage data from multiple tools. 

#testing #JavaScript #Jest #Cypress

1 month ago - specify the number of CPUs to use in #Jest tests: `npm run test -- --maxWorkers=2` Great performance gain if you don't need the machine to do other things like support a UI desktop. Nice find

Doug Parker
1 month ago

#Angular announcement: We're moving Angular to #Jest and #WebTestRunner.

We've seen a lot of movement in the web testing ecosystem towards Jest and want to make it more available for #AngularCLI users.

We've also been particular impressed with Web Test Runner and are looking forward to bringing it into the Angular ecosystem as well.

Check out the #AngularBlog for all the details:

Doug Parker
1 month ago

I feel like I'm going insane today. I just found a global variable in #NodeJS which is apparently _not_ a global? #Jest #ESM documentation states that the `jest` symbol is _not_ exposed globally and you have to import it, but sometimes it sort-of is?

console.log(typeof jest); // object
console.log(jest); // object
console.log(globalThis.jest); // undefined - WTF?!?!

Not only that, but `jest` is only defined in certain files and not others, even when one directly imports another.

This kind of behavior should be impossible and I'm completely perplexed. Is this something with `--experimental-vm-modules` or do I need to check myself into a mental hospital?

Chris Minnick
1 month ago

My latest (and greatest) book, JavaScript All-in-One For Dummies, is available now!

Every junior developer or aspiring JS developer needs this book, imho.

The book teaches modern #JavaScript, how browsers work, using #VSCode like a pro, #Git, #prettier, #eslint, #vite, #webpack, #react, #vue, #svelte, #http, #jest, #node, #express, #mongodb, #mongoose, and finishes with a chapter on authentication with #jwt.

It took me 6 months to write and is over 800 pages.

Jamie Magee :unverified:
2 months ago

Your jest tests are (probably) wrong.

Add this to your jest config to prevent leaking state between tests.

#jest #javascript #typescript #testing #unittest

Dave Mackey
2 months ago

what do you use (if you do!) for #JS/#TS #SnapshotTests?

Currently working on a TS #Vue 2.7.x project. Leaning towards using #Jest, but are there better options? I see #Playwright has snapshot capabilities as well.

#question #coding #testing

Dave Mackey
2 months ago

Update: Bug in npm, see, have to delete package.json and node_modules before

I upgraded #TS to "^5.0.2" in my package.json but #Jest (ts-jest@27.1.5 to be specific) requires typescript@">=3.8 <5.0". I've added to my package.json an overrides section:

"overrides": {
"typescript": "$typescript"

But #npm just keeps #whining about the conflicting peer dependencies.

Suggestions appreciated :)

*Why not just upgrade to Jest 29? There is a known issue with the #Vue CLI

John :dotnet: :csharp:
2 months ago

@jasongorman Watching this now, it's interesting. I've been using GPT-3.5 to help with generate some #angular unit tests, since it's been a couple of years since I've written any angular myself. It's been fairly positive albeit a little hit and miss. It's almost like pair programming with a junior dev, who's good at spotting missing brackets. It also constantly forgets to use #jest tests rather than #jasmine.

John :dotnet: :csharp:
2 months ago

ha, took a few hours but all my #jest tests are working for my #angular app.

John :dotnet: :csharp:
2 months ago

Next issue with my #angular project is to fix some more of my tests. Most of them seem to be an issue with #NgRx. I have components using Entity Services, (EntityCollectionServiceBase) and I just can't get the #Jest test set up properly to inject them. And I can't find a decent example.
Anyway, time to park it for the evening.

Everyone wants to add tools to the dev env, but nobody wants to support their team when they break the precommit hooks. #eslint #typescript #jest #tdd #danger #testCoverage #linting #husky

John :dotnet: :csharp:
2 months ago

Fixed another major issue with my #jest tests where it was including the #NgRx modules, and throwing errors. Now only 22 failing tests out of 176. #Angular.

John :dotnet: :csharp:
2 months ago

I've managed to get the #Jest tests running, though about half are now having issues with paths and not finding modules.

John :dotnet: :csharp:
2 months ago

Back on my #Angular project, fixed an issue with the routing. Now, having an issue with running #Jest tests: Cannot find module '@angular/core/testing' from 'node_modules/jest-preset-angular/build/setup-jest.js'

2 months ago

Para aquellos que usen Jest en su proyecto y además lo tengan integrado en la CI recomiendo encarecidamente actualizar a la versión 28 ya que en dicha versión añadieron la posibilidad de usar shards, bien pues aprovechando esta funcionalidad podemos dividir y ejecutar dichas partes en paralelo dentro de nuestra CI para reducir considerablemente el tiempo de ejecución de nuestros tests 🚀

Dejo artículo dónde se muestra dicha implementación:

#testing #jest #ci #shards

Chris Minnick
3 months ago

I just finished the final review of my new book (coming in May): JavaScript All-In-One For Dummies. This one has been my dream to write for over a decade, and I've been working on it for 10 months.

When I used to hire junior developers, I'd find myself (and them) overwhelmed with how much they had to know to be to be productive. This book addresses that.

#JavaScript #Git #vscode #React #Vue #Svelte #ESLint #Jest #Node #webapi #express #mongodb #webpack #babel #vite #rest #jwt #micdrop

#JavaScript and #nextjs friends. #Next allows for async server side components. react-testing-library and #jest seem to very much hate the idea of a `Promise<JSX.Element>` for any rendering. Any thoughts on proper ways to test async server components?

Alex LaFroscia
3 months ago

Having made significant progress on a large migration from #Jest to #Vitest, I can add our experience as an anecdote to the conversation about performance between the two!

Our component library saw about a 20% improvement in total time to run the tests, from about a little over 50 seconds to about 40. Not a huge win, but not bad!

An app that did the same migration showed even better improvements though, reducing the time spent by half; what used to take two minutes now takes less than one!

Damian Thater
3 months ago

#Jenkins verrichtet seinen #CICD Dienst auf dem neuen alten i5 anstandslos und sogar recht zügig. Kein Wunder, die App ist noch winzig. Sie hat gerade einmal einen einzigen #Jest #UnitTest. Immerhin ist dieser grün. 😅

3 months ago

I really like Java and Eclipse, but #TypeScript with #Jest in #VSCode, executing my tests on every change in the background and showing me missing test coverage right in the text editor is hard to beat.

Tom Jowitt
3 months ago

Spent the end of last week helping our frontend devs speed up their build/test/deploy times. I'm a bit rusty on #typescript and #javascript in general but it seems every year these systems add another layer of complexity. It's been a fun couple of days though poking around #yarn #webpack and #jest and hopefully the team are happy with significantly faster builds.

Doug Parker
3 months ago

So I've been doing a bit of research into #web #UnitTesting #tooling (#Jest, #Vitest, #Jasmine, #Karma, #WebTestRunner, ...).

I'm curious if there's any interest in a blog post on some of my takeaways about aspects like:

* Test runners vs test frameworks.
* Browser-based runners vs Node-based runners.
* Changes in the ecosystem.
* Future directions of JS unit testing.
* ...

3 months ago

Day 246 #100daysofhomelab

Spent the time updating littlelink-server and fixing unit tests. Not the most exciting work, but necessary nonetheless. Fresh docker container building in CI now!

#opensource #homelab #nodejs #react #node #reactjs #razzle #unitests #jest #docker #dockercontainer #selfhost #selfhosting #selfhosted #ci #cd #cicd

Dave Mackey
4 months ago

I asked #ChatGPT what some of the best articles on testing #Vue 2.x using #Jest were and it responded...all of the links are broken. 😂

Don't get me wrong, I'm still querying ChatGPT when Google isn't providing me with the desired answers

BUT what I'd really like is some #HumanAugmented #Search 😉

Doug Parker
4 months ago

@eliajf I was mostly looking into test runners moreso than test frameworks.

#Jest is still dominant by a huge amount, but #WebTestRunner and #JasmineBrowserRunner looked interesting to me. I've had good experiences with WTR in the past, but haven't tried Jasmine's browser runner.

4 months ago

"If ignorance is bliss, why aren't there more happy people in the world?" — Stephen Fry — — — #StephenFry #quote #quotes #quip #snarky #bliss #ignorance #humor #humorous #funny #jest #truth #joke

Tim Van Dijck
4 months ago

Working on fixing a bunch of failing tests? Try using --bail to stop Jest after the first failing test so you can tackle them one by one. #jest #javascript #react

4 months ago

Episode 23/04:

TypeScript released the beta for version 5, with stable support for decorators. They are slightly different from the experimental ones we use in Angular. Furthermore, Minko Gechev gave an update about Angular's roadmap. The focus in 2023 is on reactivity and server-side rendering.

#TypeScript 5 Beta:
#Angular Roadmap 2023:

Minor Releases:
- #NgRx 15.2 - support for functional creators:
- #Nx 15.6:
- #Cypress 12.4:
- #Playwright 1.30:
- #Jest 29.4:

Episode 23/04
Alex LaFroscia
4 months ago

Does anyone have experience with testing out the performance impact of a #Jest to #Vitest migration? After hearing about Vitest being significantly slower, I’m trying to gauge how to tell if we’ll run into that trouble before migrating the entire, complicated test suite over

Tim Van Dijck
4 months ago

Just fixing a warning from Jest has improved a unit test suite from 120 seconds of runtime down to 25. Don't ignore your warnings folks! #programming #testing #jest

Steve Fenton ♾️
5 months ago

One of the slightly punk ideas I had for JestSpec was to allow specifications written outside of pure Gherkin syntax, so you could write more naturally if you wanted to.

If you use #Jest with #JavaScript or #TypeScript you can use JestSpec to add #Gherkin, or natural language, specification files.

Go write some test prose!

Andy Balaam
5 months ago

TIL that if you get a weird error from your Jest tests about document being null, check for an infinite loop of useEffect or useCallback due to one of the use* dependencies being always-changed.

#react #jest

Queen of New York
5 months ago

Spent some time trying to get #Jest to work for our #ExpressJS app that runs in a #DockerCompose set-up. Failing miserably. I know it shouldn’t be this hard. I think I’m going to give up on the approach I was trying and just focus on endpoint testing, if I can figure out how to do that. I miss #Laravel at times like this.

Anyone have any recommendations on react component testing and mocking API-responses?

I'd preferably like to mock out the hook calling the query. Bonus if there are helps specifically for react-query

#react #nextjs #reactQuery #vitest #jest #typescript

6 months ago

Published my first #npm #ESLint package. I’ve contributed to ESLint before, but never actually published my own package.

It was not bad at all. It took about 2 hours.

The rule is really simple and not useful to most people, but it was a nice way to ensure that we don’t forget to add #a11y #axe #jest tests to our test files and I can imagine it being useful for other similar code-hygiene patterns some day:

Dan Dean
6 months ago

Writing tests for this with ts-mocha instead of #jest, and at first glance it feels so much faster. I wonder the effort required is to convert a larger codebase...

Would love to hear from anybody else using ts-mocha instead of jest for #TypeScript.

6 months ago

Trying to use Jest and TypeScript is really frustrating. I have a Jest `expect ...` assertion that checks a value, but then I have to write a separate TS expression to narrow the type that Jest just checked.

For example, "expect(stringOrNumber).toBe('x')". At this point Jest has determined that it's a string, but TS still requires me to do "if (typeof stringOrNumber === 'string') ..."

Is there a better pattern? Or a testing library that does type narrowing?

#TypeScript #Jest

We are looking for a #JavaScript Developer at Kinsta.

As part of our JS Development Team, you will be working with some of the most exciting JavaScript tools on the market to build our client-facing and internal tools.

Our stack:
#typescript #React, #nodejs #GraphQL, #SQL, #NoSQL, #Webpack, #Babel, #SWC, #Jest, #Storybook, #GitHub, #Docker, #Stripe

Check the job opening here:

Die Verantwortung für eins der populärsten Testwerkzeuge für JavaScript wandert von Meta zu der unter dem Dach der Linux Foundation geführten OpenJS Foundation.
JavaScript-Testing-Framework Jest landet bei der OpenJS Foundation

I am writing a few pure #javascript client functions and incredibly I'm enjoying it 💪 🤣
Working with #jest and pure functions is really a completely different world than piling some code frontend code