antfu / vscode-vite

One step faster for Vite in VS Code ⚡️
https://marketplace.visualstudio.com/items?itemName=antfu.vite
449 stars 25 forks source link

Support for `it.each` and `test.each` #34

Closed micthiesen closed 1 year ago

micthiesen commented 1 year ago

Clear and concise description of the problem

Currently this extension doesn't seem to recognize individual test.each test cases. For example:

describe("something", () => {
  test.each([
    { text: "bar", expected: "zoo" },
    { text: "moo", expected: "arf" },
  ])(
    "should properly parse '$expected' from '$text'",
    ({ text, expected }) => {
      expect(foo(text)).toEqual(expected)
    }
  );
});

For this test you will get an option to run/debug the describe block (works) and also the overall test function. If you click run/debug on the overall test function all the individual test cases are skipped. I think this is because the test runner is filtering on the template string: `-t some.module.spec should properly parse '\$expected' from '\$text'``

Sometimes the test statuses in the sidebar also hang, I believe when they contain a test.each or it.each.

Suggested solution

Add support for test.each / it.each, bot in the sidebar and in the run/debug breadcrumbs.

Alternative

No response

Additional context

No response

Validations

micthiesen commented 1 year ago

Oops wrong extension