Karma – 0 tests completed

Running unit testing with Karma on Google Chrome browser on a Angular 2 application.

No tests were running 😥

SUMMARY:
√ 0 tests completed

In the Chrome window, the console said

Refused to execute script from 'http://localhost:9876/base/src/tests/test.ts?b58784c03c82bb3f722dcb6d25bd26cdf145b12b' because its MIME type ('video/mp2t') is not executable

I found a solution here saying that I just need to add the following line to karma.conf.js

mime: {
'text/x-typescript': ['ts','tsx']
},

JavaScript – Stats.js

JavaScipt library that shows the Frame per Second on top of web page. Just copy-paste the following code.

function startStatsJS(){var script=document.createElement('script');script.src='http://github.com/mrdoob/stats.js/raw/master/build/stats.min.js';document.body.appendChild(script);script=document.createElement('script');script.innerHTML='var interval=setInterval(function(){if(typeof Stats==\'function\'){clearInterval(interval);var stats=new Stats();stats.domElement.style.position=\'fixed\';stats.domElement.style.left=\'0px\';stats.domElement.style.top=\'0px\';stats.domElement.style.zIndex=\'10000\';document.body.appendChild(stats.domElement);setInterval(function(){stats.update();},1000/60);}},100);';document.body.appendChild(script);};
 
startStatsJS();