Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
barlots opened this issue Apr 19, 2021 · 0 comments
Open

Comments

@barlots
Copy link

barlots commented Apr 19, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant