Javascript rant 

I'm trying to do something in Javascript. And modern javascript is a mess. There are multiple implementation of modules, incompatible with one another, and random libraries assume random implementation of modules.

I have an app that works locally in browser, but when I try to test each module of this app separately using jest/jasmine/mocha they randomly fail each one with it's own beautifully complex error message.

Javascript rant 

Maybe my requirements are not reasonable (but OTOH every other language satisfies them).

I want compile-time support from IDE, so I use typescript, I want to load some json files and some yaml fiels (but at this point I don't want to put these files in the Internet, so it all needs to be loaded and bundled together).

Why this needs to be so fuckin complex (answer: it does not but it is).

Javascript rant 

And the worst part is:

1) This is a hobby project, so when I have time to work on in next time, I will forget most of the details.

2) Instead of doing what I want, I wasted whole day on fucking with javascript (And this project will be running in browsers so I need to use JS);

3) When I finish it half of the project will be obsolete, as Javascript will be reinvented anew.


Javascript rant 

I **think** that the problem is my code is in typescript, and testing frameworks have some problems with how I use TS.

So I think I'll need to prepare special compilation code that will bundle my typescript library (with dependencies) to a single commmonjs (whaever that is) file, and then run tests against this (tests can be in JS I don't care).

The problem with that approach, that having "special build for testing" is an abomination, as you should test code you run in production.

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!