@joelanman@hachyderm.io avatar

joelanman

@joelanman@hachyderm.io

He/him, previously design lead on GOV.UK Prototype Kit and other GDS projects.

Looks after plants and animals. Anxiety and depression

This profile is from a federated server and may be incomplete. Browse more on the original instance.

joelanman, to random
@joelanman@hachyderm.io avatar

I'm getting really stuck with using Jest to unit test model files that use knex. For example if a method requires a valid id. I can't hardcode the id as I can't be sure what it will be.

So the alternative seems to be unit tests that include multiple methods. For example create, then update. But that doesn't feel like a unit test of one method?

joelanman,
@joelanman@hachyderm.io avatar

@llimllib Sorry misread, so this is a redraft! That seems close to where I'm at, but if the create bit is broken then the update test will fail, I guess that's unavoidable

joelanman, to random
@joelanman@hachyderm.io avatar

Tonight's film: Anatomy of a Fall

joelanman, to random
@joelanman@hachyderm.io avatar
joelanman, to random
@joelanman@hachyderm.io avatar

It was so exciting when Chrome came out with the V8 JavaScript engine and it was so fast, Node is based on it too. Was a real step-change

https://en.wikipedia.org/wiki/V8_(JavaScript_engine)

joelanman, to random
@joelanman@hachyderm.io avatar

When I open a plant shop I'll call it Forbidden Plant

joelanman,
@joelanman@hachyderm.io avatar

@jonty Or like radioactive plants

joelanman, to random
@joelanman@hachyderm.io avatar

I have wrangled Jest, Playwright and Knex and won. That wasn't much fun

joelanman, to random
@joelanman@hachyderm.io avatar
joelanman, to random
@joelanman@hachyderm.io avatar
joelanman, to random
@joelanman@hachyderm.io avatar

The casting of Fallout is really excellent

belldotbz, to random
@belldotbz@mastodon.social avatar
joelanman,
@joelanman@hachyderm.io avatar

@belldotbz Is it the remaster?

joelanman, to programming
@joelanman@hachyderm.io avatar

has anyone used Jest and Knex in Node? I've been banging my head against this issue for ages, and googling gets me nowhere. I just get Unable to acquire a connection every time.

My actual code works fine, it's just in Jest that it fails.

https://github.com/knex/knex/issues/6062

joelanman,
@joelanman@hachyderm.io avatar

sigh, I wasn't using dotenv correctly with Jest, you have to add it to the config like this:

setupFiles: ["dotenv/config"]  
joelanman, to accessibility
@joelanman@hachyderm.io avatar

LLMs have many issues, energy usage, ethics of training data and so on. But I will say that people in the blind community seem pretty excited by capabilities around image recognition

secretgeek, to random
@secretgeek@mastodon.cloud avatar

Google is a strangler fig, in the long term its only goal is to kill the World Wide Web.

First they help you find good content, so people visit and use and enjoy and participate in good web sites.

Then they insist on scraping every piece of value they can, and presenting it to the user such that they never have to visit the websites at all.

Then the websites die, having been choked to death by the strangler fig, and people blame the websites for dying, not the strangler who bled them dry.

joelanman,
@joelanman@hachyderm.io avatar

@secretgeek Googles motto: Kill the goose that lays the golden eggs

joelanman, to programming
@joelanman@hachyderm.io avatar

I'm using Playwright to do end to end testing and very happy with it. How do I now add unit testing? Googling isnt giving very useful results. I'm imagining something like

npm test  

triggering Jest, then Playwright, but they both look for test.js files so that seems not correct?

Can/should Playwright be used for unit testing?

joelanman,
@joelanman@hachyderm.io avatar

a google got me this, but that says to just use Playwright which doesnt seem right?

https://www.npmjs.com/package/jest-playwright-preset

joelanman,
@joelanman@hachyderm.io avatar

@floehopper perfect thanks!

joelanman, to random
@joelanman@hachyderm.io avatar

What about a Bioshock TV series? What videogame show would you like?

joelanman,
@joelanman@hachyderm.io avatar

@dletorey Nice choices!

hugh, to random
@hugh@social.crablab.uk avatar

Apparently M&S self checkouts have 32GB of RAM, which is more than many laptops.

What do they need all that RAM for? 😅 Wrong answers only.

joelanman,
@joelanman@hachyderm.io avatar

@hugh Unexpected ram in bagging area

joelanman, to random
@joelanman@hachyderm.io avatar

Midnight Suns is interesting but I don't like the art style, quite mobile game

siblingpastry, to accessibility
@siblingpastry@mastodon.world avatar

Writing up some best-practice patterns for form controls, and I've assembled this list of native HTML controls that should never be used (because they're not universally supported, and/or their native UI has accessibility problems):

<input type="color">
<input type="date">
<input type="datetime">
<input type="datetime-local">
<input type="number">
<input type="time">
<input type="week">

Any debate on those? Anything I've missed?

joelanman,
@joelanman@hachyderm.io avatar

@cwilcox808 @siblingpastry @yatil Another aspect of us switching to inputmode is type=number silently rejects non numeric input which we don't think is good practice, we have the same stance on maxlength

joelanman,
@joelanman@hachyderm.io avatar

@siblingpastry @cwilcox808 @yatil I would argue the default hit area for the stepper buttons doesnt meet the minimum required (might be an exception since it's native but I think that's a technicality, it doesn't actually make it accessible)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • normalnudes
  • kavyap
  • rosin
  • everett
  • Backrooms
  • DreamBathrooms
  • magazineikmin
  • GTA5RPClips
  • Youngstown
  • slotface
  • khanakhh
  • InstantRegret
  • hgfsjryuu7
  • thenastyranch
  • provamag3
  • mdbf
  • ethstaker
  • Leos
  • ngwrru68w68
  • cisconetworking
  • cubers
  • Durango
  • osvaldo12
  • tacticalgear
  • anitta
  • modclub
  • tester
  • JUstTest
  • All magazines