@suitest/smst-to-text
v4.13.0
Published
Utility to convert SMST to plain text or ANSI-styled text
Downloads
18,453
Readme
SMST 2 TEXT
A library to convert smst to plain text and formatted text.
For a complete demo on library usage check out SuitestAutomation/translate-demo repo.
Usage example:
import {translateTestLineResult} from '@suitest/translate';
import {toText} from '@suitest/smst-to-text';
// Fetch data you need to translate, e.g. using Suitest Network API
const testLineDefinition = {/* get line definition somehow */};
const testLineResult = {/* get line definition somehow */};
const appConfig = {/* get app configuration somehow */};
const smst = translateTestLineResult({
testLine: testLineDefinition,
lineResult: testLineResult,
appConfig,
});
const plainTextLine = toText(smst);
// Or if you want a text with ANSI formatting
const formattedTextLine = toText(smst, true);