nosh :fosstodon: (ʘ‿ʘ) · @nosherwan
496 followers · 4852 posts · Server fosstodon.org

Unit Testing
Jest
Knex.js

I am looking for suggestions for testing knex.js functions in jest.
mocking knex via jest automock still leaves out knex.raw function.

How do you guys test your functions that utilise knex.js?




#db #knexjs #jest #mock

Last updated 1 year ago

yuval · @yuvharpaz
28 followers · 226 posts · Server nerdculture.de

Two new MIRI images of (a part of) Cas A supernova remnants were published, here I display them over a previous image in red

#jest

Last updated 1 year ago

undefined is not a fun · @dev
0 followers · 2 posts · Server swj.io

Wondering if there's any out here who have tactics for reducing CI test run times?

I have an E2E test suite that takes 24-30mins across all shards and since it's E2E I can't really run the ones tied to commit changes using static analysis since the files under test aren't directly imported in the suite.

I'm considering using coverage stats to figure out which tests to run for a given commit but curious about prior art 🤔 🎨 ❓

#Devs #jest

Last updated 1 year ago

Tulkdan · @tulkdan
1 followers · 29 posts · Server techhub.social

So did anyone ever used managed by in a non-nixos?

I'm having trouble to run extension because it can't find my PATH

#vscode #homemanager #jest

Last updated 1 year ago

The project I get paid to work on takes > ten minutes to install, build, and test from a fresh repo. That's not hyperbole. It's just two built with and . There aren't even any functional !

Ten fucking minutes everytime I switch branches!!

#transpiling #webdev #strugglestack #tests #e2e #jest #nixos #yarn #nextjs #typescript #websites

Last updated 1 year ago

Joe Lanman · @joelanman
614 followers · 1366 posts · Server hachyderm.io

anyone got experience closing a db connection after all Jest tests using Knex? Nothing I'm trying works, it just hangs unless I use forceExit which I'd rather not

#dev #jest #javascript

Last updated 1 year ago

Kyle 🦚 · @kyle
71 followers · 71 posts · Server social.coop

Getting stuck on a testing error after hours of work updating dependencies:

"Cannot redefine property: window"

My emotional response at this point is just "how dare you defy me"

#jest

Last updated 1 year ago

Ricard Torres · @ricard
371 followers · 1890 posts · Server ricard.social

I love having proper unit tests (using in my scenario), they give me so much confidence when it comes to specification changes to the component's logic.

I don't even need to spawn the whole server to test it out, I know it will work.

#jest

Last updated 1 year ago

JRJurman · @jrjurman
22 followers · 41 posts · Server fosstodon.org

Added tests to Tram-Lite, using 🎉

In the past, I've usually leaned on and but even for this super simple library, Cypress was easy, incredibly fast, and better reflects the actual behavior of the browser.

I understand for libraries it feels like unit-tests should be the go to, but over time I've realized that e2e forces you to put your library in real scenarios, rather than fake / idealized scenarios that might not happen.

#e2e #cypress #jest #testinglibrary #tramlite #webdev #testing

Last updated 1 year ago

Doug Parker · @develwithoutacause
220 followers · 797 posts · Server techhub.social

A few people have asked when is moving forward with and whether or not we considered as an alternative.

So I wrote up a fairly in-depth discussion about some of our thinking around the the current web testing ecosystem and why we opted for Jest over Vitest for the time being.

github.com/angular/angular-cli

#angular #jest #vitest

Last updated 1 year ago

steamgrunge 🔻 · @cybergrunge
248 followers · 124 posts · Server diaspodon.fr

Bon, .

J’essaye d’intégrer à mes unitaires le bon démarrage de mon serveur .

J’utilise .

Le fichier racine est dans ./src/modules/server.js.

Jest l’exécute bien, mais il s’obstine à chercher mes vues dans ./views alors qu’elles sont dans ./src/views.

Le serveur une fois lancé, lui, n’a aucun problème avec ce dossier.

Comment je peux dire à Jest que le processus doit être lancé depuis ./src, et que les chemins sont relatifs à ça ?

:retootPlz:

#alaide #tests #node #jest

Last updated 1 year ago

Peter · @parcifal
21 followers · 247 posts · Server hachyderm.io

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 at the moment should I just learn the framework more? trying to mock everything seems to take me an eternity sometimes.

#jest #testing #webdevelopment

Last updated 1 year ago

avalon · @avalonas
12 followers · 530 posts · Server ohai.social

@chowderman
Learning about how upset this possibility makes certain individuals,
should not upset an Nor is the calling of names for anything
other than a encouraged. (though it does happen)

#omnist #jest

Last updated 2 years ago

Lars Gyrup Brink Nielsen 🇩🇰 · @LayZee
172 followers · 162 posts · Server mastodon.nu

CLI 16 introduces experimental first-class support with the @angular-devkit/build-angular:jest builder blog.angular.io/moving-angular

#jest #angular

Last updated 2 years ago

Doug Parker · @develwithoutacause
211 followers · 755 posts · Server techhub.social

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 and improved schematics.
🛠️ Faster builds with and in developer preview.
🃏 Experimental support.
🅰️ ... and way more!

Check out our blog post for all the deets.

blog.angular.io/angular-v16-is

#angular #universal #esbuild #vite #jest

Last updated 2 years ago

· @joncombe
0 followers · 1 posts · Server mastodon.xyz

I made a tool which converts text to javascript Jest tests: text2jest.com What do you think?

#jest #javascript #testing

Last updated 2 years ago

robrich · @robrich
20 followers · 162 posts · Server hachyderm.io

dev.to/darkmavis1980/how-to-mo - set env vars for tests:

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

Great quick tip github.com/darkmavis1980.

#jest

Last updated 2 years ago

robrich · @robrich
20 followers · 160 posts · Server hachyderm.io

dev.to/ddoice/fix-slow-tests-w - specify the number of CPUs to use in 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 github.com/ddoice.

#jest

Last updated 2 years ago