lukeed / uvu

uvu is an extremely fast and lightweight test runner for Node.js and the browser
MIT License
2.97k stars 100 forks source link

Filter by test description doesn't work #232

Closed peterbe closed 1 year ago

peterbe commented 1 year ago
❯ uvu tests
end-to-end.mjs
• • • • • • • • • • • • • • • • • • •   (19 / 19)

  Total:     19
  Passed:    19
  Skipped:   0
  Duration:  1256.94ms

So it finds the file tests/end-to-end.mjs. Good. Within that file, there are 19 tests. One of them looks like this:

test("home page", async () => {
  const response = await get("/");
  assert.is(response.statusCode, 200);
  assert.ok(isCached(response));
  assert.is(response.headers["content-encoding"], "br");
});

How do I run only that test and not the other 18?

I tried the second [pattern] argument but perhaps that's about filtering files.

❯ uvu tests home

  Total:     0
  Passed:    0
  Skipped:   0
  Duration:  0.73ms

and

❯ uvu tests 'home page'

  Total:     0
  Passed:    0
  Skipped:   0
  Duration:  0.75ms
lukeed commented 1 year ago

You only to use test.only() within the test files. Doing it from the CLI is a duplicate of #74