npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@suitest/smst

v4.9.0

Published

UNIST definition and JSX factory for Suitest test lines rendering

Downloads

14,384

Readme

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