fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

9.9K
active users

#knexjs

0 posts0 participants0 posts today
Peƚeɾ<p>First time using <a href="https://knexjs.org/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">knexjs.org/</span><span class="invisible"></span></a> today 😬 I have a lot to learn</p><p><a href="https://hachyderm.io/tags/knexjs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>knexjs</span></a></p>
nosh :fosstodon: (ʘ‿ʘ)<p>Unit Testing<br />Jest<br />Knex.js</p><p>I am looking for suggestions for testing knex.js functions in jest.<br />mocking knex via jest automock still leaves out knex.raw function.</p><p>How do you guys test your functions that utilise knex.js?</p><p><a href="https://fosstodon.org/tags/db" class="mention hashtag" rel="tag">#<span>db</span></a> <br /><a href="https://fosstodon.org/tags/knexjs" class="mention hashtag" rel="tag">#<span>knexjs</span></a> <br /><a href="https://fosstodon.org/tags/jest" class="mention hashtag" rel="tag">#<span>jest</span></a> <br /><a href="https://fosstodon.org/tags/mock" class="mention hashtag" rel="tag">#<span>mock</span></a></p>
nosh :fosstodon: (ʘ‿ʘ)<p><span class="h-card" translate="no"><a href="https://mastodon.social/@wiredprairie" class="u-url mention">@<span>wiredprairie</span></a></span> nice to know.</p><p>For some years I was using ORMs but in the end that were too much of a hassle.</p><p>I use knex.js now, it is a middle ground between having complete string based queries to have some type safety that does not get in one&#39;s way.</p><p><a href="https://fosstodon.org/tags/knexjs" class="mention hashtag" rel="tag">#<span>knexjs</span></a></p>
nosh :fosstodon: (ʘ‿ʘ)<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@sirber" class="u-url mention">@<span>sirber</span></a></span> sorry autocorrect screwed my comment.</p><p>I used to use orms but they caused more problems.</p><p>I was spending more time figuring out how to write a query in orm syntax where as I knew already how to do it in sql.</p><p>Query builders come to the rescue they are in between orms and plain typless sql in code.</p><p>They provide some type safety but you can use sql in your backend framework.</p><p>Knex.js is the one I use.</p><p><a href="https://fosstodon.org/tags/knexjs" class="mention hashtag" rel="tag">#<span>knexjs</span></a> <br /><a href="https://fosstodon.org/tags/orm" class="mention hashtag" rel="tag">#<span>orm</span></a> <br /><a href="https://fosstodon.org/tags/sql" class="mention hashtag" rel="tag">#<span>sql</span></a> <br /><a href="https://fosstodon.org/tags/QueryBuilders" class="mention hashtag" rel="tag">#<span>QueryBuilders</span></a></p>
Nosh<p>For <a href="https://mastodon.social/tags/backend" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>backend</span></a> I use:</p><p><a href="https://mastodon.social/tags/koa" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>koa</span></a><br><a href="https://mastodon.social/tags/apolloGraphQL" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>apolloGraphQL</span></a> <br><a href="https://mastodon.social/tags/nodejs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>nodejs</span></a><br><a href="https://mastodon.social/tags/knexjs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>knexjs</span></a><br><a href="https://mastodon.social/tags/typeScript" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>typeScript</span></a></p><p>I only use typescript for loose typing and syntax completion. I dont use it for OOP.</p>