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;
}
Bug
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