joelanman,
@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"]  
  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • kavyap
  • thenastyranch
  • Durango
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • cisconetworking
  • Youngstown
  • mdbf
  • slotface
  • osvaldo12
  • GTA5RPClips
  • rosin
  • InstantRegret
  • provamag3
  • everett
  • cubers
  • vwfavf
  • normalnudes
  • tacticalgear
  • tester
  • ethstaker
  • khanakhh
  • modclub
  • Leos
  • anitta
  • megavids
  • JUstTest
  • All magazines