Home

Learn unit tests.

Simple tests in the browser.

let assert = function( exp ) { let result = eval( exp ); if( !result ) { document.write( '<span style="color: red;">Test failed: ' + exp + '</span><br>' ); } else { document.write( '<span style="color: green;">Test OK: ' + exp + '</span><br>' ); } } let s = 'Megamachine' assert( "typeof s === 'string' || s instanceof String" ) assert( "s.slice( 3 ) == 'machine'" )

Use tsunit with javascript.

Get tsunit here: https://github.com/elelpublic/tsunit