Skip to content

Show test name with --watch #594

@takuyahara

Description

@takuyahara

When ran with --watch test name described in test(), it() and describe() is not shown but I prefer to be.

When not watched

❯ bun run tstyche 
$ tstyche
uses TypeScript 5.9.2 with ./src/__tests__/tsconfig.json

pass ./src/__tests__/greet.tst.ts
  + isSameLength

Targets:    1 passed, 1 total
Test files: 1 passed, 1 total
Tests:      1 passed, 1 total
Assertions: 3 passed, 3 total
Duration:   0.4s

When watched

❯ bun run tstyche --watch
uses TypeScript 5.9.2 with ./src/__tests__/tsconfig.json

pass ./src/__tests__/greet.tst.ts

Press a to run all tests.
Press x to exit.

Test code

import { expect, test } from "tstyche";

function isSameLength<T extends { length: number }>(a: T, b: T) {
  return a.length === b.length;
}

test("isSameLength", () => {
  expect(isSameLength([1, 2], [1, 2, 3])).type.toBe<boolean>();
  expect(isSameLength("one", "two")).type.toBe<boolean>();

  expect(isSameLength).type.not.toBeCallableWith(1, 2);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions