async function or async => when exporting default?

The first one is generally preferred. It’s a declaration, not an expression value, which has subtle advantages. And it can easily be named if you want, which is a good practice. Also, arrow functions have a few disadvantages in certain situations, so unless you absolutely need them to preserve a this value (etc.) you’d rather … Read more

Does ES6 import/export need “.js” extension?

No, modules don’t care about extensions. It just needs to be a name that resolves to a source file. In your case, http://localhost/bla/src/drawImage is not a file while http://localhost/bla/src/drawImage.js is, so that’s where there error comes from. You can either add the .js in all your import statements, or configure your server to ignore the … Read more

Is there any way to mock private functions with Jest?

If you want to mock a private function, try to use the prototype. For example, you need to mock privateFunction of the following class: export class Module { public publicFunction() { // do something this.privateFunction(); // do something } private privateFunction() { // do something } } So you should use Module.prototype in the jest.spyOn … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)