Skip to content

possible to use programmatically? #59

Description

@mmkal

Hi, this looks v useful! For existing projects with vitest/playwright, is there an API we could use for explicit/programmatic usage? I could imagine something like

import { test } from 'vitest';
import { createTuiTest } from '@microsoft/tui-test';

test('git', async () => {
  await using terminal = createTuiTest({ program: { file: 'git' } });
  const expect = terminal.expect;

  await expect(terminal.getByText('usage: git', { full: true })).toBeVisible();
});

Where the await using ensures any necessary teardown gets done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions