The code-coverage for extjs files works well.
Now, I want to test some simple prototype functions like:
file: /js/common/Prototypes.js
if ( !String.prototype.capitalizeFirst ) {
String.prototype.capitalizeFirst = function ()
{
return this.charAt( 0 ).toUpperCase() + this.slice( 1 );
};
}
StartTest( function ( t )
{
t.it( "String.prototype.capitalizeFirst", function ( t )
{
t.is( "aaa".capitalizeFirst(), "Aaa" );
t.is( "baa".capitalizeFirst(), "Baa" );
} );
} );
Configs:
var harness = new Siesta.Harness.Browser.ExtJS();
harness.configure( {
title: 'Interpid Test Suite',
viewDOM: true,
enableCodeCoverage: true,
//coverageUnit: 'extjs_class', // can be "file" or "extjs_class"
coverageUnit: 'file', // can be "file" or "extjs_class"
// Define any global JS and CSS dependencies, these files will be injected into each test.
preload: preloadsExt5,
// If your tests use dynamic loading, you can setup your paths using the 'loaderPath' config.
loaderPath: {
'Ipd': BASE_URL + '/js/ipd',
'Ext.ux': BASE_URL + '/vendor/js/extjs-ux/6.5.0'
}
} );
harness.start(
{
group: 'Ipd',
items: [
{
group: 'Prototypes',
items: [
{
preload: [
BASE_URL + '/js/common/Prototypes.js'
],
url: 'prototype/String.t.js'
}
]
},
...