How to list all tests that are located in a testcafe test file?

40 views Asked by At

I've got a lot of tests in various files, some of them are simple tests, and others are data-driven, and names are generated by json dynamically.

I need to list all test names, of each file.

For example, here is a file I've got:

fixture`example`;

[
  'test 1',
  'test 2',
  'test 3',
  'test 4',
].forEach(name => {
  test(name, async t => {
    // do some stuff here
  });
});

I want the output to be something like:

file1.test.ts has the following tests:
test 1
test 2
test 3
test 4

file-n.test.ts has the following tests:
test a
test b
test c
test d

I want to get this information without running the actual tests, and I suppose testcafe has some internal methods to get it done. Please, help.

0

There are 0 answers