open-index/open-npm huggingface dataset:
npm package: @suitest/smst-to-html
Description: Utility to convert SMST to HTML
Latest version: 4.13.0

# SMST 2 HTML

A library to convert smst to HTML fragment.

For a complete demo on library usage check out [SuitestAutomation/translate-demo] repo.

Usage example:

```javascript
import {translateTestLineResult} from '@suitest/translate';
import {toHtml} from '@suitest/smst-to-html';

// 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 htmlFragmentLine = toHtml(smst);
```

## Output examples

![HTML output](./docs/html.png)

[SuitestAutomation/translate-demo]: https://github.com/SuitestAutomation/translate-demo
npm package: @suitest/smst-to-text
Description: Utility to convert SMST to plain text or ANSI-styled text
Latest version: 4.28.5

# 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:

```javascript
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](./docs/text-plain.png)

### Formatted text

![Formatted text output](./docs/text-formatted.png)

[SuitestAutomation/translate-demo]: https://github.com/SuitestAutomation/translate-demo
npm package: @suitest/translate
Description: A module that translate Suitest server messages to human readable strings
Latest version: 4.31.0

# Suitest test execution results translation

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SuitestAutomation/suitest/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/@suitest/translate.svg?style=flat)](https://www.npmjs.com/package/@suitest/translate)
[![unit tests](https://github.com/SuitestAutomation/suitest/actions/workflows/tests.yml/badge.svg)](https://github.com/SuitestAutomation/suitest/actions/workflows/tests.yml)

This package contains all results that Suitest may return for the test execution and translations for those errors.

Error translations support small subset of Markdown text formatting:

* Bold text `**bold**`
* Code block `` `code` ``
* Hyperlinks `[text](url){attribute: 'value'}`
* Images `![caption](src){attribute: 'value'}`

Messages are split into following categories:

* [Test bootstrap](/packages/translate/docs/bootstrap.md)

## Using the library

Library provides 2 builds: UMD library is loaded by default when importing
`@suitest/translate` and commonJS is available in case you need to import
specific files. E.g. if you would want to get a list of Suitest message
code you could import `@suitest/translate/commonjs/constants.js`.

The UMD build is isomorphic and already minified. It has one peer dependency - "unist-builder".
Make sure it's either available is node_modules (when running in NodeJS), or as a global "ub" variable in browser.

CommonJS build is not minified and meant to be used with NodeJS (or with bundler).

## Lines and line result translation

`@suitest/translate` can translate a line (optionally with line result) into a [smst] format. Then, you can use
one of the following libs to convert smst into human readable language:

* [@suitest/smst-to-text] - to convert it to the plain text format
* [@suitest/smst-to-html] - to convert it to HTML fragment

For a complete demo on library usage check out [SuitestAutomation/translate-demo] repo.

[smst]: https://github.com/SuitestAutomation/suitest/tree/master/packages/smst
[@suitest/smst-to-text]: https://github.com/SuitestAutomation/suitest/tree/master/packages/smst-to-text
[@suitest/smst-to-html]: https://github.com/SuitestAutomation/suitest/tree/master/packages/smst-to-html
[SuitestAutomation/translate-demo]: https://github.com/SuitestAutomation/translate-demo