Skip to content

[Bug] Tests run inside arrow function are not listed and lacking names #220

@barlots

Description

@barlots

Bug

  • Version of Majestic: v1.8.0
  • Version of Jest: 26.0.20
  • Version of Node: v15.12.0
  • Operating System: Windows 10 Pro 20H2

Reproduction:

Test evaluated inside arrow function (in order to be used multiple times with different parameters) is sometimes detected by Majestic as one, nameless test entry in GUI, or not visible at all

// calc.test.ts
import { add } from "./calc";

const testAdd = (a: number, b: number, expected: number) => {
  test(`should '${a}' + '${b}' be '${expected}'`, () => {
    var result = add(a, b);
    expect(result).toBe(expected);
  });
};

testAdd(1, 1, 2);
testAdd(2, 2, 4);
testAdd(2, -1, 1);



// calc.ts
export function add(a: number, b: number): number {
  return a + b;
}

obraz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions