Socket
Socket
Sign inDemoInstall

@suitest/smst

Package Overview
Dependencies
1
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @suitest/smst

UNIST definition and JSX factory for Suitest test lines rendering


Version published
Weekly downloads
3.4K
decreased by-8.11%
Maintainers
2
Install size
23.8 kB
Created
Weekly downloads
 

Readme

Source

SMST

Suitest message syntax tree.

Suitest flavour of the unist domain-specific syntax tree, designed to express test line definitions, results and other user-facing messages. SMST can be used to render messages in plain text, text with ANSI styling and HTML.

Nodes

Text

Inline plain text.

interface Text {
    type: "text"
    value: string
}

Subject

Inline text, that represents test line subject name

interface Subject <: Text {
    type: "subject"
}

See Text.

Input

Inline text, that represents user-defined values in test lines, e.g. expectations.

interface Input <: Text {
    type: "input"
}

See Text.

Code

Inline code.

interface Code <: Text {
    type: "code"
}

See Text.

Paragraph

A collection of simple text nodes.

interface Paragraph {
    type: "paragraph"
    children: InlineText[]
}

See InlineText

CodeBlock

A block of code.

interface CodeBlock {
    type: "code-block"
    language: "javascript" | "brightscript"
    value: string
}

See Paragraph.

Property

A single prop in the properties table.

interface Property {
    type: "prop"
    prop: Paragraph
    comparator: string
    expectedValue: Paragraph
    actualValue: [Paragraph | CodeBlock]
    status: ["success" | "failure"]
}

See Paragraph and CodeBlock.

Properties

A simple table, where each row represents a property

interface Properties {
    type: "props"
    children: Property[]
}

See Property.

Condition

A test line condition. Could be used in assertions or as a part of conditional line. For example, element [my element] exists is a condition and can be used in such lines:

  • Assert element [my element] exists timeout 2s
  • Press button OK only if element [my element] exists

Condition consists of title and optional Properties table. Could also include result status when rendering test line result.

interface Condition {
    type: "condition"
    title: Paragraph
    children: [Properties]
    status: ["success" | "fail"]
}

See Paragraph and Properties.

TestLine

Represent a single Suitest test line.

interface TestLine {
    type: "test-line"
    title: Paragraph
    children: [(Properties | Condition)[]]
    status: ["success" | "fatal" | "fail" | "warning" | "exit" | "excluded"]
}

See Paragraph, Properties and [Condition][dfn-condition]

TestLineResult

Test line result is a wrapper around TestLine, that also includes execution results for that line.

interface TestLineResult {
    type: "test-line-result"
    level: "success" | "fatal" | "fail" | "warning" | "exit" | "excluded"
    children: TestLine
    message: [Paragraph],
    screenhost: [string],
}

See Paragraph and TestLine

Enumeration

InlineText

Any inline text node.

type InlineText = Text | Subject | Input | Code

Keywords

FAQs

Last updated on 19 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc