包详细信息

@suitest/smst-to-text

SuitestAutomation33.1kMIT4.13.0

Utility to convert SMST to plain text or ANSI-styled text

自述文件

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);

Output examples

Plain text

Plain text output

Formatted text

Formatted text output