Post AApUYUbNNHPRZDsPRI by jacek@mastodon.technology
 (DIR) More posts by jacek@mastodon.technology
 (DIR) Post #AApUYTNVvKj7lwNpC4 by jacek@mastodon.technology
       2021-08-29T20:59:24Z
       
       0 likes, 0 repeats
       
       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.
       
 (DIR) Post #AApUYU1ZWOllmB7odE by jacek@mastodon.technology
       2021-08-29T21:02:27Z
       
       0 likes, 0 repeats
       
       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).
       
 (DIR) Post #AApUYUbNNHPRZDsPRI by jacek@mastodon.technology
       2021-08-29T21:04:35Z
       
       0 likes, 0 repeats
       
       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.
       
 (DIR) Post #AApUYV9PKkdDGlnaU4 by dhfir@expired.mentality.rip
       2021-08-29T21:15:59.866725Z
       
       0 likes, 0 repeats
       
       @jacek idk what exactly you need javascript for but I know there are sites that do without it, so maybe try and see if you can do that, ot at least minimize the js?
       
 (DIR) Post #AApUYVkH7g7d7731wu by jacek@mastodon.technology
       2021-08-29T21:11:14Z
       
       0 likes, 0 repeats
       
       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.