Skip to content
Reference > AmiScript API > Classes

CodeCoverage

Definition

CodeCoverage var = .... ;

Extends

Extended By

None

Description

Handle for measuring which evaluation expressions of a host's scripts have run (obtain via a host function, e.g. ami_center.getCodeCoverage()).

Method Summary

Owner Name Return Type Description
Object getClassName() String Returns the string name of this object's class type.
CodeCoverage getState() String Whether coverage is 'shutdown', 'started' or 'paused'.
CodeCoverage pause() String Stop listening, keeping everything captured and recorded so far. Only valid while started.
CodeCoverage report() Table One row per script: how many of its expressions ran, and which ones did not.
CodeCoverage report(targetId) Table One script at a time: a row per expression, which id it is, what it represents, and whether it ran. Ex: report("TRIGGER:orders^callback=onInserted").
CodeCoverage reset() String Capture again from the scripts as they stand now, empty the results, and listen. Only valid while started or paused.
CodeCoverage resume() String Listen again. Only valid while paused.
CodeCoverage shutdown() String Stop listening and discard everything captured and recorded. Only valid while started or paused.
CodeCoverage startup() String Capture what can be covered and begin listening; returns the new state. Only valid while shutdown.
Object toJson() String Returns a string of a json representation of this object.

Method Definitions


getClassName()

String Object::getClassName()

Description

Returns the string name of this object's class type.


getState()

String CodeCoverage::getState()

Description

Whether coverage is 'shutdown', 'started' or 'paused'.


pause()

String CodeCoverage::pause()

Description

Stop listening, keeping everything captured and recorded so far. Only valid while started.


report()

Table CodeCoverage::report()

Description

One row per script: how many of its expressions ran, and which ones did not.


report(targetId)

Table CodeCoverage::report(String targetId)

Description

One script at a time: a row per expression, which id it is, what it represents, and whether it ran. Ex: report("TRIGGER:orders^callback=onInserted").

Parameter Definition

Name Type Description
targetId String 

reset()

String CodeCoverage::reset()

Description

Capture again from the scripts as they stand now, empty the results, and listen. Only valid while started or paused.


resume()

String CodeCoverage::resume()

Description

Listen again. Only valid while paused.


shutdown()

String CodeCoverage::shutdown()

Description

Stop listening and discard everything captured and recorded. Only valid while started or paused.


startup()

String CodeCoverage::startup()

Description

Capture what can be covered and begin listening; returns the new state. Only valid while shutdown.


toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.