Notes of Maks Nemisj

Experiments with JavaScript

javascript

How to test React.js components

In this article I will explain “Why should you test react.js components”, “How can you do testing” and “What are the problems you might come across”. Testing solution which I use, doesn’t rely on the Test-utils of React and on DOM implementation ( so that you can do the node.js testing ). Why/How to test […]

, , , ,

Conditional ie comments in react.js

Sometimes easy things appear to be more complicated, than initially thought. For example conditional IE comments in HTML, which I had to add today to a code I write. At my work we have to support Internet Explorer browser version 9 an higher . In order to use media-queries we decided to use https://github.com/weblinc/media-match polyfill […]

, , , , ,

NPM, tmp and npm-xxx uncleaned paths

UPDATE: Created npm module to fix this stuff – https://www.npmjs.com/package/clean-npm-tmp Today I came to work and it appeared that builds on our Jenkins ( CI environment ) are broken due to “No space left on device” error. Further investigation showed that the whole /tmp folder was filled with strange “npm-xxx” folders, which in their turn […]

, ,

“git root” – root folder of the git repository

How often do you wanted to go to the root of the git repository? If not very often, then I do it quite often. Mercurial has this nice command hg root, but git not. In order to do it in git you have to use some long command ‘rev-parse –show-toplevel’ which I even can’t remember. […]

,

Using = null; instead of ;

How often have you done this in you code? Instead of this? While it might be used to accomplish the same result, the code above has some hidden pitfall in it. Image situation that you always use the code above, also inside your for statements. If you wouldn’t be careful enough, you might trap in […]

,

Vim script for Node.js and ‘gf’

I wrote a vim script which can help you to do ‘gf’ on require statements when coding node.js modules. It uses node.js module resolution algorithm to add all the node_modules folders into the vim path variable, so that you can do ‘gf’ on modules which are not relative to the current folder of the file. […]

, ,

Previous Posts Next posts