ConsoleInterceptor class - Drop-in replacement for window.console making output controllable.
class ConsoleInterceptor extends EventDispatcher {
constructor( options, debug ) {}
console : Console // Native console
native : Boolean // Log to native status
events : Boolean // Log to events status
detach() {} // Boolean
}
For more details check the ConsoleInterceptor source file.
- debug.{console.method} - Fired when a given {console.method} is called, as in "debug.log" or "debug.error".
tabFocus - Display outline on focused elements
tabFocus( style = '2px dashed deeppink', offset = '4px', log = true ) // Function
Binds a global event to highlight elements focused by keyboard control and returns a callback to unbind.
Parameter | Type | Default | Description |
---|---|---|---|
style | String | '2px dashed deeppink' | CSS outline style |
offset | String | '4px' | CSS outline offset |
log | Boolean | true | Log focused element to console |
Type/Value | Description |
---|---|
Function | Callback to remove tabFocus |
const disableTabFocus = tabFocus(); // Enable tab focus debug
disableTabFocus(); // Disable tab focus debug
TestRunner class - Basic test wrapper for frontend code.
class TestRunner {
constructor( render ) {}
render : Console // Native console or other output object
run( test ) {} // TRTestResult[]
display( results ) {} // void
}
For more details check the ConsoleInterceptor source file.